inogen/app/admin/components/FormTabs.tsx
2026-10-18 18:12:59 +03:30

17 lines
517 B
TypeScript

type FormTab = { id: string; label: string };
export function FormTabs({ tabs, active, onChange }: { tabs: FormTab[]; active: string; onChange: (id: string) => void }) {
return <div className="form-tabs" role="tablist" aria-label="بخش‌های فرم">
{tabs.map(tab => <button
key={tab.id}
type="button"
role="tab"
aria-selected={active === tab.id}
className={active === tab.id ? "active" : ""}
onClick={() => onChange(tab.id)}
>{tab.label}</button>)}
</div>;
}