import * as React from 'react'; import { CircleAlert, CircleCheck, Info, Sparkles, TriangleAlert, } from 'lucide-react'; import * as Alert from '@/components/ui/alert'; import { toast } from '@/components/ui/toast'; type AlertToastProps = { t: string | number; status?: React.ComponentPropsWithoutRef['status']; variant?: React.ComponentPropsWithoutRef['variant']; message: string; dismissable?: boolean; icon?: React.ElementType; }; const AlertToast = React.forwardRef< React.ComponentRef, AlertToastProps >( ( { t, status = 'feature', variant = 'stroke', message, dismissable = true, icon, }, forwardedRef, ) => { let Icon: React.ElementType; if (icon) { Icon = icon; } else { switch (status) { case 'success': Icon = CircleCheck; break; case 'warning': Icon = TriangleAlert; break; case 'error': Icon = CircleAlert; break; case 'information': Icon = Info; break; case 'feature': Icon = Sparkles; break; default: Icon = CircleAlert; break; } } return ( {message} {dismissable && ( )} ); }, ); AlertToast.displayName = 'AlertToast'; export { AlertToast as Root };