import { Children, isValidElement, type PropsWithChildren, type ReactNode } from 'react' import { cn, TabsIndicator, TabsList, Tabs as TabsRoot, TabsTrigger } from 'ui' interface CodeTabPanelProps { id: string label?: string icon?: ReactNode } interface CodeTabsProps { value?: string onValueChange?: (value: string) => void } export function NamedCodeBlock({ name, children }: PropsWithChildren<{ name: string }>) { return (
{name} {children}
) } export function CodeTabs({ children, value, onValueChange }: PropsWithChildren) { const tabs = Children.toArray(children).filter(isValidElement) return ( {tabs.map((tab) => ( {tab.props.icon} {tab.props.label ?? tab.props.id} ))} {children} ) }