feat(ui): replace native confirm() with DaisyUI modal composable (F7.2)

Create useConfirm composable (promise-based, singleton state) and
ConfirmModal component. Replace all 10 confirm()/window.confirm() calls
across 9 pages and 1 composable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matthieu
2026-02-09 11:20:13 +01:00
parent 046f464378
commit 6152848957
11 changed files with 152 additions and 21 deletions

View File

@@ -705,13 +705,15 @@ const editMachine = (machine) => {
navigateTo(`/machine/${machine.id}?edit=true`)
}
const { confirm: confirmDialog } = useConfirm()
const confirmDeleteMachine = async (machine) => {
const { showError, showSuccess } = useToast()
if (
confirm(
`Êtes-vous sûr de vouloir supprimer la machine "${machine.name}" ? Cette action est irréversible.`
)
await confirmDialog({
message: `Êtes-vous sûr de vouloir supprimer la machine "${machine.name}" ? Cette action est irréversible.`,
})
) {
try {
const result = await deleteMachine(machine.id)