/** * @file PageTabs.tsx * @description Shared top-of-page tab bar used by the pages that merged several * former routes into one (Settings hub, Sessions/Events history). Rendering only - * the owning page keeps the active tab in its own query param. * @author Nguyễn Ngọc Trí Vĩ */ import type { ComponentType } from "react"; export interface PageTab { id: string; label: string; Icon: ComponentType<{ className?: string }>; } interface PageTabsProps { tabs: PageTab[]; activeId: string; onSelect: (id: string) => void; ariaLabel: string; } /** * Horizontal tab strip for a page that hosts several panels. * @param props - Tabs to render, the active tab id, and the selection callback. * @returns The tab bar element. */ export function PageTabs({ tabs, activeId, onSelect, ariaLabel }: PageTabsProps) { return (
{tabs.map(({ id, label, Icon }) => { const isActive = id === activeId; return ( ); })}
); }