import { CircleX, CircleCheck, AlertTriangle, Info } from 'lucide-react'; import React from 'react'; interface MessageBoxProps { status: 'error' | 'info' | 'warning' | 'success' | 'default' | 'done' icon?: React.ReactNode title?: string children: React.ReactNode | React.ReactNode[] className?: string } export function MessageBox({ icon, status, title, children, className }: MessageBoxProps) { let defaultIcon, titleColor, textColor, bgColor; switch (status) { case 'error': { defaultIcon = titleColor = ""; textColor = "text-foreground"; bgColor = "bg-destructive border border-destructive"; break; } case 'warning': { defaultIcon = titleColor = ""; textColor = "text-foreground"; bgColor = "bg-attention border border-attention"; break; } case 'success': { defaultIcon = titleColor = ""; textColor = "text-foreground"; bgColor = "bg-success border border-success"; break; } case 'info': { defaultIcon = titleColor = ""; textColor = "text-foreground"; bgColor = "bg-info border border-info"; break; } case 'default': { defaultIcon = titleColor = ""; textColor = "text-foreground"; bgColor = "bg-muted border border-muted"; break; } case 'done': { defaultIcon = titleColor = ""; textColor = "text-foreground"; bgColor = "bg-done border border-done"; break; } } return (
{children}