({ tabs, children }: TabProps)
| 9 | }; |
| 10 | |
| 11 | export function Tabs({ tabs, children }: TabProps) { |
| 12 | return ( |
| 13 | <TabsPrimitive.Root defaultValue={tabs[0].value}> |
| 14 | <TabsPrimitive.List className=""> |
| 15 | {tabs.map(({ value, label }) => ( |
| 16 | <TabsPrimitive.Trigger |
| 17 | value={value} |
| 18 | key={`tab-trigger-${value}`} |
| 19 | className={cx( |
| 20 | "group", |
| 21 | "mr-1 px-4 py-1 rounded-t-sm transition", |
| 22 | "text-slate-500 hover:bg-slate-100 hover:bg-opacity-50 dark:text-slate-300 dark:hover:bg-slate-900 dark:hover:bg-opacity-40", |
| 23 | "radix-state-active:bg-slate-100 radix-state-active:bg-opacity-50 radix-state-active:dark:bg-slate-900 radix-state-active:dark:text-white" |
| 24 | )} |
| 25 | > |
| 26 | {label} |
| 27 | </TabsPrimitive.Trigger> |
| 28 | ))} |
| 29 | </TabsPrimitive.List> |
| 30 | {children} |
| 31 | </TabsPrimitive.Root> |
| 32 | ); |
| 33 | } |
| 34 | |
| 35 | export const TabContent = React.forwardRef< |
| 36 | React.ElementRef<typeof TabsPrimitive.Content>, |
nothing calls this directly
no outgoing calls
no test coverage detected