"use client" import * as React from "react" import { Index } from "@/__registry__" import { cn } from "@/lib/utils" import { useConfig } from "@/hooks/use-config" import { Icons } from "@/components/icons" interface ThemeComponentProps extends React.HTMLAttributes { name: string extractClassname?: boolean extractedClassNames?: string align?: "center" | "start" | "end" } export function ThemeComponent({ name, ...props }: ThemeComponentProps) { const [config] = useConfig() const Preview = React.useMemo(() => { const Component = Index[config.style][name]?.component if (!Component) { return (

Component{" "} {name} {" "} not found in registry.

) } return }, [name, config.style]) return (
Loading...
} > {Preview} ) }