import React, { useRef } from 'react' import { useForm } from '@inertiajs/react' export default function ModalImport(props) { const { modalState } = props const { data, setData, post, progress, errors, clearErrors } = useForm({ file: null, }); const inputFileImport = useRef(); const handleReset = () => { setData({file: null}); inputFileImport.current.value = "" clearErrors(); }; const handleCancel = () => { modalState.toggle() handleReset(); }; function handleSubmit(e) { e.preventDefault(); post(route("docs.import"), { forceFormData: false, onSuccess: () => Promise.all([handleReset(), modalState.toggle()]), }); return; } return (
Unduh format file import{" "} disini