/** * Product-aware scope config for school/program (Prism family) and * site/location (One — Sites). Shared by sidebar `TeamSwitcher` and * `UtilityBarSchoolSwitcher`. */ import type { Product } from "@/contexts/product-context" import { NAV_LOCATION_DEFAULT, NAV_PROGRAM_DEFAULT, NAV_SCHOOL_DEFAULT, NAV_SCHOOLS, NAV_SITE_DEFAULT, NAV_SITES, type NavSchool, type NavSite, } from "@/lib/mock/navigation" export interface ScopeParent { id: string name: string logo: string initials: string } export interface ScopeChild { id: string name: string } export interface ScopeConfig { parents: ReadonlyArray defaultParent: ScopeParent defaultChild: ScopeChild childrenOf: (parent: ScopeParent) => ReadonlyArray /** Singular noun for the child scope ("Program", "Location"). */ childNoun: string /** Font Awesome glyph suffix for child rows. */ childIcon: string /** Aria suffix for the trigger ("Switch school or program", …). */ ariaSuffix: string /** Sub-view label ("Select school", "Select site"). */ parentSelectLabel: string } const SCHOOL_PROGRAM_SCOPE: ScopeConfig = { parents: NAV_SCHOOLS, defaultParent: NAV_SCHOOL_DEFAULT, defaultChild: NAV_PROGRAM_DEFAULT, childrenOf: parent => (parent as NavSchool).programs, childNoun: "Program", childIcon: "graduation-cap", ariaSuffix: "Switch school or program", parentSelectLabel: "Select school", } const SITE_LOCATION_SCOPE: ScopeConfig = { parents: NAV_SITES, defaultParent: NAV_SITE_DEFAULT, defaultChild: NAV_LOCATION_DEFAULT, childrenOf: parent => (parent as NavSite).locations, childNoun: "Location", childIcon: "location-dot", ariaSuffix: "Switch site or location", parentSelectLabel: "Select site", } export function scopeConfigForProduct(product: Product): ScopeConfig { return product === "exxat-one-sites" ? SITE_LOCATION_SCOPE : SCHOOL_PROGRAM_SCOPE }