import type { ComponentType } from "react" import type { RegionConfig } from "../../src/regional/types" export interface TabConfig { /** Unique identifier used as the Radix Tabs value. */ id: string /** Label rendered in the tab bar. */ label: string /** Component rendered when this tab is active. */ component: ComponentType /** * Region IDs in which this tab is visible. * Omit (or leave undefined) to show the tab in all regions. * @deprecated Prefer `featureFlag` for new tabs. `regions` is kept for backwards compatibility. */ regions?: string[] /** * Feature flag key from `RegionConfig["features"]` that gates this tab. * When set, the tab is only shown if `config.features[featureFlag]` is true. * Prefer this over `regions` for new tabs — avoid mixing both on the same tab * for clarity, though AND semantics apply if both are set. */ featureFlag?: keyof RegionConfig["features"] /** * Ascending sort order within the tab bar. * Tabs with equal order retain their declaration order. * @default 0 */ order?: number /** Render the tab trigger in a disabled state (visible but not clickable). */ disabled?: boolean } export interface TabLayoutProps { /** Base tabs declared by the MFE. */ tabs: TabConfig[] /** * Additional tabs injected at mount-time (e.g. by a host shell or feature flag). * Merged with `tabs` before filtering and sorting. */ extraTabs?: TabConfig[] /** * Active region identifier — used by the legacy `regions` allowlist filter. * Required as long as any tab uses the `regions` field; otherwise unused. * Typically sourced from `process.env.DAAS_REGION`. */ region: string /** * Tab ID to activate on first render. * Defaults to the first visible tab. */ defaultTabId?: string className?: string }