({ tabs, currentTab, className }: TabSwitcherProps)
| 12 | } |
| 13 | |
| 14 | export function TabSwitcher({ tabs, currentTab, className }: TabSwitcherProps) { |
| 15 | const router = useRouter() |
| 16 | |
| 17 | const handleTabChange = (value: string) => { |
| 18 | router.push(`?tab=${value}`, { scroll: false }) |
| 19 | } |
| 20 | |
| 21 | return ( |
| 22 | <TabsList className={className}> |
| 23 | {tabs.map((tab) => ( |
| 24 | <LowProfileTabsTrigger |
| 25 | key={tab.value} |
| 26 | value={tab.value} |
| 27 | onClick={() => handleTabChange(tab.value)} |
| 28 | data-state={currentTab === tab.value ? "active" : ""} |
| 29 | > |
| 30 | {tab.label} |
| 31 | </LowProfileTabsTrigger> |
| 32 | ))} |
| 33 | </TabsList> |
| 34 | ) |
| 35 | } |
| 36 | |
| 37 | interface LowProfileTabsTrigger { |
| 38 | value: string |
nothing calls this directly
no test coverage detected