import { jsx as _jsx } from "react/jsx-runtime";
import { useRef } from 'react';
import { useTranslation } from 'react-i18next';
import AppModal from '../AppModal';
import AppDropzoneBodyLocal from './AppDropzoneBodyLocal';
export default function AppDropzoneLocal({ onClose, onSuccess, onError, accept, onDrop, title, alternativeButton, }) {
    const { t } = useTranslation('upload');
    const bodyRef = useRef(null);
    const handleConfirm = () => {
        void bodyRef.current?.upload();
    };
    return (_jsx(AppModal, { title: title || t('modal.title'), className: "modal-upload-local", close: onClose, confirm: handleConfirm, alternativeButton: alternativeButton, children: _jsx(AppDropzoneBodyLocal, { ref: bodyRef, onSuccess: onSuccess, onError: onError, accept: accept, onDrop: onDrop, showConfirmButton: false }) }));
}
