import clsx from 'clsx' import Link from 'next/link' import { useState } from 'react' 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 }) { const { tabs, defaultIndex } = props const [activeIndex, setActiveIndex] = useState(defaultIndex ?? 0) const activeTab = tabs[activeIndex] return (
{activeTab.content}
) }