/** * Custom destructive-action confirm dialog, styled like a SweetAlert prompt * (centered icon, title, description, cancel/confirm) but built on the * WordPress core Modal primitive — no new dependency required. */ import { Modal, Button } from '@wordpress/components'; import { AlertTriangle } from 'lucide-react'; interface ConfirmDialogProps { title: string; description: string; confirmLabel: string; cancelLabel: string; onConfirm: () => void; onCancel: () => void; /** * Optional second destructive choice, shown between Cancel and the primary * confirm — e.g. Mega Menu's "Reset all styles" next to "Reset this style". */ secondaryLabel?: string; onSecondary?: () => void; } export default function ConfirmDialog( { title, description, confirmLabel, cancelLabel, onConfirm, onCancel, secondaryLabel, onSecondary, }: ConfirmDialogProps ) { return (

{ title }

{ description }

{ secondaryLabel && onSecondary && ( ) }
); }