Files
prowler/ui/app/(prowler)/providers/provider-page-tabs.shared.ts
T
Pablo Fernandez Guerra (PFE) d23c2f3b53 refactor(ui): standardize "Providers" wording across UI and docs (#10971)
Co-authored-by: Pablo F.G <pablo.fernandez@prowler.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 14:39:54 +02:00

22 lines
593 B
TypeScript

const PROVIDER_TAB = {
PROVIDERS: "providers",
PROVIDER_GROUPS: "provider-groups",
} as const;
type ProviderTab = (typeof PROVIDER_TAB)[keyof typeof PROVIDER_TAB];
function isProviderTab(value: string): value is ProviderTab {
return Object.values(PROVIDER_TAB).includes(value as ProviderTab);
}
function getProviderTab(value: string | string[] | undefined): ProviderTab {
if (typeof value !== "string") {
return PROVIDER_TAB.PROVIDERS;
}
return isProviderTab(value) ? value : PROVIDER_TAB.PROVIDERS;
}
export type { ProviderTab };
export { getProviderTab, PROVIDER_TAB };