"use client"; import type { ReactNode } from "react"; import { AlertTriangle, X } from "lucide-react"; type ConfirmActionDialogProps = { open: boolean; title: string; description: string; confirmLabel: string; cancelLabel?: string; tone?: "danger" | "warning" | "info"; note?: string; icon?: ReactNode; onClose: () => void; onConfirm: () => void; }; const toneStyles = { danger: { color: "#ef4444", softBackground: "rgba(239,68,68,0.08)", strongBackground: "rgba(239,68,68,0.12)", border: "rgba(239,68,68,0.22)", lightBorder: "rgba(239,68,68,0.18)", }, warning: { color: "#f59e0b", softBackground: "rgba(245,158,11,0.08)", strongBackground: "rgba(245,158,11,0.12)", border: "rgba(245,158,11,0.22)", lightBorder: "rgba(245,158,11,0.18)", }, info: { color: "#3b82f6", softBackground: "rgba(59,130,246,0.08)", strongBackground: "rgba(59,130,246,0.12)", border: "rgba(59,130,246,0.22)", lightBorder: "rgba(59,130,246,0.18)", }, } as const; export default function ConfirmActionDialog({ open, title, description, confirmLabel, cancelLabel = "Cancel", tone = "danger", note, icon, onClose, onConfirm, }: ConfirmActionDialogProps) { if (!open) { return null; } const palette = toneStyles[tone]; return (
event.stopPropagation()} >
{icon ?? }
{title}

{description}

{note ? (
{note}
) : null}
); }