import React, { useState, JSX } from "react"; interface Tab { id: string; title: string | JSX.Element; content: JSX.Element; disabled?: boolean; } interface TabsProps { tabs: Tab[]; style?: "default" | "box"; className?: { container?: string; tab?: string; content?: string; }; } export default function Tabs({ tabs, style = "default", className, }: TabsProps) { const [activeTab, setActiveTab] = useState(tabs[0]?.id || ""); return ( <>
{tabs.map((tab) => (
{activeTab === tab.id && tab.content}
))}
); }