/** * Alert Component * Displays important messages to users */ import React from "react"; import { AlertCircle, CheckCircle, Info, XCircle, X } from "lucide-react"; import { __ } from "../../lib/i18n"; interface AlertProps { variant?: "success" | "error" | "warning" | "info"; title?: string; children: React.ReactNode; onClose?: () => void; className?: string; } export const Alert: React.FC = ({ variant = "info", title, children, onClose, className = "", }) => { const variantClasses = { success: "bg-green-50 text-green-800 border-green-200 dark:bg-green-900/20 dark:text-green-400 dark:border-green-800", error: "bg-red-50 text-red-800 border-red-200 dark:bg-red-900/20 dark:text-red-400 dark:border-red-800", warning: "bg-yellow-50 text-yellow-800 border-yellow-200 dark:bg-yellow-900/20 dark:text-yellow-400 dark:border-yellow-800", info: "bg-blue-50 text-blue-800 border-blue-200 dark:bg-blue-900/20 dark:text-blue-400 dark:border-blue-800", }; const icons = { success: CheckCircle, error: XCircle, warning: AlertCircle, info: Info, }; const Icon = icons[variant]; return (
{title &&

{title}

}
{children}
{onClose && ( )}
); };