import React from 'react'; import { Text } from '../Text/Text'; import { useTheme } from '../../core/theme/ThemeProvider'; import { useStyles } from '../../core/hooks/useStyles'; interface AlertProps { title: string; children?: React.ReactNode; variant?: 'info' | 'warning' | 'error' | 'success'; className?: string; } const icons = { info: ``, warning: ``, error: ``, success: `` }; export const Alert: React.FC = ({ title, children, variant = 'info', className = '' }) => { const { theme } = useTheme(); const createStyle = useStyles('alert'); const iconHtml = { __html: icons[variant] }; const variantStyles = { info: { backgroundColor: 'rgba(59, 130, 246, 0.2)', borderColor: 'rgba(59, 130, 246, 0.5)', color: '#93c5fd' }, warning: { backgroundColor: 'rgba(245, 158, 11, 0.2)', borderColor: 'rgba(245, 158, 11, 0.5)', color: '#fcd34d' }, error: { backgroundColor: 'rgba(239, 68, 68, 0.2)', borderColor: 'rgba(239, 68, 68, 0.5)', color: '#fca5a5' }, success: { backgroundColor: 'rgba(16, 185, 129, 0.2)', borderColor: 'rgba(16, 185, 129, 0.5)', color: '#6ee7b7' }, }; const containerClass = createStyle({ display: 'grid', gridTemplateColumns: 'auto 1fr', alignItems: 'start', gap: theme.spacing.md, borderRadius: '8px', border: '1px solid', padding: theme.spacing.md, ...variantStyles[variant], '@supports (backdrop-filter: none) or (-webkit-backdrop-filter: none)': { backdropFilter: 'blur(12px)', }, }); return ( {title} {children && {children}} ); };