import React from 'react' import { createPortal } from 'react-dom' /** * Bei blocker.state === "blocked": Speichern, Abbrechen (auf Seite bleiben), Verwerfen (Navigation fortsetzen). */ export default function UnsavedChangesPrompt({ blocker, isBusy, onSave, onDiscardWithoutSave, title = 'Ungespeicherte Änderungen', detail = 'Es gibt Änderungen, die noch nicht gespeichert sind. Was möchten Sie tun?', }) { if (!blocker || blocker.state !== 'blocked') return null return createPortal(
{ if (e.target === e.currentTarget && !isBusy) blocker.reset() }} >
e.stopPropagation()}>

{title}

{detail}

, document.body, ) }