import clsx from 'clsx' import Link from 'next/link' import { useState } from 'react' import { Row } from './row' type Tab = { title: string tabIcon?: JSX.Element content: JSX.Element // 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?: (tabName: string) => void }) { const { tabs, defaultIndex, className, onClick } = props const [activeIndex, setActiveIndex] = useState(defaultIndex ?? 0) const activeTab = tabs[activeIndex] return (
{activeTab.content}
) }