mirror of
https://github.com/hanzoai/home.git
synced 2026-10-30 18:34:19 +00:00
@hanzo/home. No history, no remote, not on GitHub. Co-authored-by: Hanzo Dev <[email protected]>
29 lines
504 B
TypeScript
29 lines
504 B
TypeScript
'use client'
|
|
|
|
interface Tab {
|
|
id: string
|
|
label: string
|
|
}
|
|
|
|
interface TabsProps {
|
|
tabs: Tab[]
|
|
active: string
|
|
onChange: (id: string) => void
|
|
}
|
|
|
|
export function Tabs({ tabs, active, onChange }: TabsProps) {
|
|
return (
|
|
<div className="tabs">
|
|
{tabs.map(tab => (
|
|
<button
|
|
key={tab.id}
|
|
className={`tab-btn ${active === tab.id ? 'active' : ''}`}
|
|
onClick={() => onChange(tab.id)}
|
|
>
|
|
{tab.label}
|
|
</button>
|
|
))}
|
|
</div>
|
|
)
|
|
}
|