correction bug
deploy / deploy (push) Successful in 31s

This commit is contained in:
Romain committed 2026-10-04 13:38:33 +02:00
1 parent eaad6f1e77
commit a5da756803
51 files changed
+537 -672

No files matched your search

+2 -7
View File
@@ -1,5 +1,5 @@
import { t } from '../i18n'
import { useEffect } from 'react'
import { useEscape } from '../lib/escape'
interface Props {
open: boolean
@@ -12,12 +12,7 @@ interface Props {
/** 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) {
useEffect(() => {
if (!open) return
const onKey = (e: KeyboardEvent) => e.key === 'Escape' && onCancel()
window.addEventListener('keydown', onKey)
return () => window.removeEventListener('keydown', onKey)
}, [open, onCancel])
useEscape(onCancel, open)
if (!open) return null
return (