/** * ErrorMessage — now powered by shadcn/ui Alert base styles * * Keeps the same props interface (variant, showIcon, children) for backward * compatibility. Uses Alert-inspired styling with destructive color tokens. */ import { forwardRef } from "react"; import { cva, type VariantProps } from "class-variance-authority"; import { cn } from "@/shared/utils"; import { ExclamationCircleIcon } from "@heroicons/react/24/outline"; const errorMessageVariants = cva("flex items-center gap-1 text-sm", { variants: { variant: { default: "text-destructive", inline: "text-destructive", subtle: "text-destructive/80", }, }, defaultVariants: { variant: "default", }, }); interface ErrorMessageProps extends React.HTMLAttributes, VariantProps { showIcon?: boolean; } const ErrorMessage = forwardRef( ({ className, variant, showIcon = true, children, ...props }, ref) => { if (!children) return null; return (

{showIcon && } {children}

); } ); ErrorMessage.displayName = "ErrorMessage"; export { ErrorMessage, errorMessageVariants }; export type { ErrorMessageProps };