import { sanitizeHtml } from "../../utils/sanitizeHtml"; const ICONS: Record = { info: "ℹ", tip: "✓", warning: "⚠", product: "★", }; type VariantStyle = { wrapper: string; header: string; icon: string }; const VARIANT: Record = { info: { wrapper: "border-blue-500 bg-blue-50", header: "text-blue-600", icon: "text-blue-500", }, tip: { wrapper: "border-green-500 bg-green-50", header: "text-green-700", icon: "text-green-600", }, warning: { wrapper: "border-amber-400 bg-amber-50", header: "text-amber-700", icon: "text-amber-500", }, product: { wrapper: "border-accent bg-accent/[0.06]", header: "text-accent", icon: "text-accent", }, }; export type Props = { title?: string; body?: string; variant?: "info" | "tip" | "warning" | "product"; }; export default function Callout({ title, body, variant = "info" }: Props) { const v = VARIANT[variant] ?? VARIANT.info; return (
{(title || variant) && (
{title && ( {title} )}
)} {body && (
)}
); }