import clsx from 'clsx' import Link from 'next/link' import { ReactNode, useState } from 'react' import { Row } from './row' type Tab = { title: string tabIcon?: ReactNode content: ReactNode // If set, change the url to this href when the tab is selected href?: string } export function Tabs(props: { tabs: Tab[] defaultIndex?: number className?: string onClick?: (tabTitle: string, index: number) => void }) { const { tabs, defaultIndex, className, onClick } = props const [activeIndex, setActiveIndex] = useState(defaultIndex ?? 0) const activeTab = tabs[activeIndex] return (
{activeTab.content}
) }