import { useTranslation } from 'react-i18next' import { useFileTreeActionable } from '../../contexts/file-tree-actionable' import OLModal, { OLModalBody, OLModalFooter, OLModalHeader, OLModalTitle, } from '@/features/ui/components/ol/ol-modal' import OLButton from '@/features/ui/components/ol/ol-button' import OLNotification from '@/features/ui/components/ol/ol-notification' function FileTreeModalDelete() { const { t } = useTranslation() const { isDeleting, inFlight, finishDeleting, actionedEntities, cancel, error, } = useFileTreeActionable() if (!isDeleting) return null // the modal will not be rendered; return early function handleHide() { cancel() } function handleDelete() { finishDeleting() } return ( {t('delete')}

{t('sure_you_want_to_delete')}

{error && ( )}
{inFlight ? ( ) : ( <> {t('cancel')} {t('delete')} )}
) } export default FileTreeModalDelete