import type { ComponentChildren } from 'preact'; import { Check, X } from 'lucide-preact'; import { t } from '@/lib/i18n'; interface ConfirmDialogProps { open: boolean; title: string; message: string; showIcon?: boolean; confirmText?: string; cancelText?: string; danger?: boolean; hideCancel?: boolean; onConfirm: () => void; onCancel: () => void; children?: ComponentChildren; afterActions?: ComponentChildren; } export default function ConfirmDialog(props: ConfirmDialogProps) { if (!props.open) return null; return (
{ e.preventDefault(); props.onConfirm(); }} >

{props.title}

{props.message}
{props.children} {!props.hideCancel && ( )} {props.afterActions}
); }