import type { HTMLAttributes, ReactNode } from 'react'; import clsx from 'clsx'; import styles from './styles.module.css'; export type AlertVariant = 'info' | 'success' | 'warning' | 'danger'; export type AlertProps = HTMLAttributes & { variant?: AlertVariant; title?: string; icon?: ReactNode; action?: ReactNode; }; export default function Alert({ action, children, className, icon, role, title, variant = 'info', ...props }: AlertProps) { return (
{icon && {icon}}
{title && {title}} {children}
{action &&
{action}
}
); }