import { CircleCheck, CircleX, Info, TriangleAlert } from "lucide-react"; import { forwardRef, type HTMLAttributes, type ReactNode } from "react"; import { cn } from "@/lib/utils"; import { cva } from "class-variance-authority"; type CalloutProps = Omit< HTMLAttributes, "title" | "type" | "icon" > & { title?: ReactNode; /** * @defaultValue info */ type?: "info" | "warn" | "error" | "success" | "warning"; /** * Force an icon */ icon?: ReactNode; }; const calloutVariants = cva( "my-4 flex gap-2 rounded-lg border border-s-2 bg-fd-card p-3 text-sm text-fd-card-foreground shadow-md border-dashed rounded-none", { variants: { type: { info: "border-s-blue-500/50", warn: "border-s-orange-500/50", error: "border-s-red-500/50", success: "border-s-green-500/50", }, }, }, ); export const Callout = forwardRef( ({ className, children, title, type = "info", icon, ...props }, ref) => { if (type === "warning") type = "warn"; return (
{icon ?? { info: , warn: ( ), error: , success: ( ), }[type]}
{title ?

{title}

: null}
{children}
); }, ); Callout.displayName = "Callout";