import type { ComponentType } from 'react'; interface SubTab { id: T; label: string; icon: ComponentType<{ size?: number; className?: string }>; } interface Props { tabs: readonly SubTab[]; active: T; onChange: (id: T) => void; } export default function SubTabs({ tabs, active, onChange }: Props) { return (
{tabs.map(({ id, label, icon: Icon }) => { const isActive = active === id; return ( ); })}
); }