import { type VariantProps, cva } from "class-variance-authority"; import * as React from "react"; import { cn } from "./lib/utils"; const alertVariants = cva( "flex sm:flex-row flex-col gap-x-3 gap-y-2 rounded-md border p-4", { variants: { variant: { default: "bg-gray-50 text-foreground", destructive: "text-destructive border-destructive/50 dark:border-destructive [&>svg]:text-destructive text-destructive", }, }, defaultVariants: { variant: "default", }, }, ); const Alert = React.forwardRef< HTMLDivElement, React.HTMLAttributes & VariantProps & { icon: React.ComponentType<{ className?: string }>; } >(({ className, icon: Icon, children, variant, ...props }, ref) => (
{Icon ? ( ) : null}
{children}
)); Alert.displayName = "Alert"; Alert.displayName = "Alert"; const AlertTitle = React.forwardRef< HTMLParagraphElement, React.HTMLAttributes >(({ className, ...props }, ref) => (
)); AlertTitle.displayName = "AlertTitle"; const AlertDescription = React.forwardRef< HTMLParagraphElement, React.HTMLAttributes >(({ className, ...props }, ref) => (
)); AlertDescription.displayName = "AlertDescription"; export { Alert, AlertDescription, AlertTitle };