import { ReactNode } from "react"; import { useTranslation } from "react-i18next"; import { ScrollArea } from "~/components/ui/scroll-area"; import { DashboardTableOfContents } from "./toc"; import clsx from "clsx"; export type PreviewComponentProps = { title: string; description: string; variants: | { id: string; title: string; component: ReactNode; code?: string; description?: string; }[] | { id: string; title: string; iframe: string; code?: string; description?: string; }[]; className?: string; withToc?: boolean; overflow?: "hidden" | "visible"; }; export default function PreviewComponent({ title, description, variants, className, withToc = true, overflow = "hidden" }: PreviewComponentProps) { const { t } = useTranslation(); return (

{title}

{description}

{variants.map((variant, index) => (

{variant.title}

{variant.description}

{"iframe" in variant ?