import React from 'react'; import { XMarkIcon, ExclamationTriangleIcon } from '@heroicons/react/24/outline'; import Portal from './Portal'; interface Props { open: boolean; title: string; message: string; confirmLabel?: string; cancelLabel?: string; danger?: boolean; loading?: boolean; onConfirm: () => void; onCancel: () => void; /** محتوای اضافه زیر پیام (مثلاً فیلد دلیل). */ children?: React.ReactNode; } export default function ConfirmDialog({ open, title, message, confirmLabel = 'تأیید', cancelLabel = 'لغو', danger = false, loading = false, onConfirm, onCancel, children, }: Props) { if (!open) return null; return (
e.stopPropagation()}>

{title}

{message}

{children}
); }