import { useId } from 'react' import { t } from '../i18n' import { useBackToClose } from '../lib/backNav' import { useEscape } from '../lib/escape' interface Props { open: boolean title: string message?: string confirmLabel?: string onConfirm: () => void onCancel: () => void } /** Fenêtre « Êtes-vous sûr ? » intégrée à l'app (plus fiable que window.confirm sur mobile). */ export default function ConfirmDialog({ open, title, message, confirmLabel = t('common.confirm'), onConfirm, onCancel }: Props) { useEscape(onCancel, open) useBackToClose(onCancel, open) const titleId = useId() if (!open) return null return (
e.stopPropagation()} >

{title}

{message &&

{message}

}
) }