import * as React from "react";
import { InfoIcon, TriangleAlertIcon } from "lucide-react";
import { cn } from "../lib/utils";
type InfoVariant = "default" | "warning";
const variantClassName: Record<
InfoVariant,
{
readonly root: string;
readonly icon: string;
}
> = {
default: {
root: "border-border/70 bg-card/50 text-foreground",
icon: "text-muted-foreground",
},
warning: {
root: "border-border/70 border-l-foreground/40 bg-card text-foreground shadow-xs dark:border-border/70 dark:border-l-foreground/30 dark:bg-card/70",
icon: "text-muted-foreground",
},
};
function Info({
className,
variant = "default",
children,
...props
}: React.ComponentProps<"section"> & {
readonly variant?: InfoVariant;
}) {
const Icon = variant === "warning" ? TriangleAlertIcon : InfoIcon;
const variantClass = variantClassName[variant];
return (