import { useForm } from "@inertiajs/inertia-react"; import React, { useRef } from "react"; export default function ImportModal(props) { const { isOpen, toggle = () => {}, booking = null } = props; const { data, setData, post, progress, errors, clearErrors } = useForm({ file_booking_import: null, }); const inputFileImport = useRef(); const handleReset = () => { setData({ file_booking_import: "", }); clearErrors(); }; const handleCancel = () => { toggle(); handleReset(); }; function handleSubmit(e) { e.preventDefault(); post(route("monitoring-booking.import"), { forceFormData: false, onSuccess: () => Promise.all([handleReset(), toggle()]), }); return; } return (

Import File Booking

Unduh format file import{" "} disini

handleSubmit(e)}> setData("file_booking_import", e.target.files[0]) } /> {progress && ( {progress.percentage}% )}
); };