import { cn } from "~/utils/cn"; import { Header2 } from "./Headers"; import { Paragraph } from "./Paragraph"; import { type ReactNode } from "react"; const variants = { info: { panelStyle: "border-grid-bright bg-background-bright rounded-md border p-4 gap-3", }, upgrade: { panelStyle: "border-indigo-400/20 bg-indigo-800/10 rounded-md border p-4 gap-3", }, minimal: { panelStyle: "max-w-full w-full py-3 px-3 gap-2", }, }; type InfoPanelVariant = keyof typeof variants; type Props = { title?: string; children: React.ReactNode; accessory?: ReactNode; icon: React.ComponentType; iconClassName?: string; variant?: InfoPanelVariant; panelClassName?: string; }; export function InfoPanel({ title, children, accessory, icon, iconClassName, variant = "info", panelClassName = "max-w-sm", }: Props) { const Icon = icon; const variantStyle = variants[variant]; return (
{accessory}
{title && {title}} {typeof children === "string" ? ( {children} ) : ( children )}
); }