import type { IconName } from '../ui/Icon';
import type { BadgeTone, OrganizationStatus, PlatformRouteId } from './platformTypes';

export interface PlatformNavItem {
  id: PlatformRouteId;
  label: string;
  icon: IconName;
}

export interface PlatformNavGroup {
  label: string;
  items: PlatformNavItem[];
}

export const PLATFORM_NAV_GROUPS: PlatformNavGroup[] = [
  {
    label: 'Console',
    items: [
      { id: 'p-overview', label: 'Dashboard', icon: 'dashboard' },
      { id: 'p-tenants', label: 'Tenants', icon: 'accounts' },
    ],
  },
  {
    label: 'Governance',
    items: [{ id: 'p-audit', label: 'Platform audit', icon: 'shield' }],
  },
];

export const VALID_PLATFORM_ROUTES = new Set<PlatformRouteId>(PLATFORM_NAV_GROUPS.flatMap((group) => group.items.map((item) => item.id)));

export const ORG_STATUS_LABEL: Record<OrganizationStatus, string> = {
  ACTIVE: 'Active',
  SUSPENDED: 'Suspended',
};

export const ORG_STATUS_TONE: Record<OrganizationStatus, BadgeTone> = {
  ACTIVE: 'green',
  SUSPENDED: 'red',
};
