import React from 'react' import { useForm } from '@inertiajs/react' import { useModalState } from '@/hooks' import Modal from '@/Components/Modal' import Button from '@/Components/Button' import LocationProfileSelectionInput from '../LocationProfile/SelectionInput' import FormInput from '@/Components/FormInput' import FormInputDate from '@/Components/FormInputDate' import ModalConfirm from '@/Components/ModalConfirm' export default function ModalDelete(props) { const { modalState } = props const confirmModal = useModalState() const { data, setData, post, processing } = useForm({ location_profile_id: null, comment: '', import_date: null, rule: 0, }) const rules = [ { val: 0, key: 'Hapus Sesuai Filter' }, { val: 1, key: 'Hapus Keseluruhan' }, ] const handleOnChange = (event) => { setData( event.target.name, event.target.type === 'checkbox' ? event.target.checked ? 1 : 0 : event.target.value ) } const handleClose = () => { modalState.toggle() } const onDelete = () => { post(route('voucher.bulk-destroy')) modalState.toggle() } return ( <> setData('location_profile_id', id)} /> { setData('import_date', date) }} label="Tanggal Import" />
) }