MCPcopy Create free account
hub / github.com/sourcebot-dev/sourcebot / TabSwitcher

Function TabSwitcher

packages/web/src/components/ui/tab-switcher.tsx:14–35  ·  view source on GitHub ↗
({ tabs, currentTab, className }: TabSwitcherProps)

Source from the content-addressed store, hash-verified

12}
13
14export 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
37interface LowProfileTabsTrigger {
38 value: string

Callers

nothing calls this directly

Calls 1

handleTabChangeFunction · 0.85

Tested by

no test coverage detected