import React from 'react'; import './style.scss'; export interface Tab { id: string; label: string; icon?: React.ReactNode; disabled?: boolean; } export interface TabGroupProps { /** Array of tabs */ tabs: Tab[]; /** Currently active tab ID */ activeTab: string; /** Tab change handler */ onChange: (tabId: string) => void; /** Tab variant */ variant?: 'default' | 'underline' | 'pills'; /** Tab size */ size?: 'small' | 'medium' | 'large'; /** Full width tabs */ fullWidth?: boolean; /** Custom className */ className?: string; } export const TabGroup: React.FC = ({ tabs, activeTab, onChange, variant = 'underline', size = 'medium', fullWidth = false, className = '' }) => { return (
{tabs.map((tab) => ( ))}
); }; export interface TabPanelProps { /** Tab ID this panel belongs to */ tabId: string; /** Currently active tab ID */ activeTab: string; /** Panel content */ children: React.ReactNode; /** Keep mounted when inactive */ keepMounted?: boolean; /** Custom className */ className?: string; } export const TabPanel: React.FC = ({ tabId, activeTab, children, keepMounted = false, className = '' }) => { const isActive = activeTab === tabId; if (!isActive && !keepMounted) { return null; } return (
{children}
); };