import { use, useEffect } from 'react'; import { Check, TriangleAlert, Info, ShieldAlert } from 'lucide-react'; import { cn } from '@/lib/cn'; import { DialogContext } from './context'; import type { DialogIconProps } from './types'; const icons = { danger: ShieldAlert, warning: TriangleAlert, success: Check, info: Info, }; const iconClass = 'flex items-center justify-center w-10 h-10 rounded-full mr-4'; const iconTypeClass = { danger: 'bg-destructive text-destructive-foreground', warning: 'bg-warning text-warning-foreground', success: 'bg-success text-success-foreground', info: 'bg-primary text-primary-foreground', }; const DialogIcon = ({ type, position, className }: DialogIconProps) => { const { setIcon, setIconPosition } = use(DialogContext); useEffect(() => { const Icon = icons[type]; setIcon(