import { AlertTriangle, LucideIcon } from "lucide-react"; // ui import { Button, TButtonVariant } from "@plane/ui"; // components import { EModalPosition, EModalWidth, ModalCore } from "@/components/core"; // helpers import { cn } from "@/helpers/common.helper"; export type TModalVariant = "danger"; type Props = { content: React.ReactNode | string; handleClose: () => void; handleSubmit: () => Promise; hideIcon?: boolean; isDeleting: boolean; isOpen: boolean; position?: EModalPosition; primaryButtonText?: { loading: string; default: string; }; secondaryButtonText?: string; title: string; variant?: TModalVariant; width?: EModalWidth; }; const VARIANT_ICONS: Record = { danger: AlertTriangle, }; const BUTTON_VARIANTS: Record = { danger: "danger", }; const VARIANT_CLASSES: Record = { danger: "bg-red-500/20 text-red-500", }; export const AlertModalCore: React.FC = (props) => { const { content, handleClose, handleSubmit, hideIcon = false, isDeleting, isOpen, position = EModalPosition.CENTER, primaryButtonText = { loading: "Deleting", default: "Delete", }, secondaryButtonText = "Cancel", title, variant = "danger", width = EModalWidth.XL, } = props; const Icon = VARIANT_ICONS[variant]; return (
{!hideIcon && ( )}

{title}

{content}

); };