/** Carrier Dashboard tabs — shared by the page (deep links) and the client component. */
export const TABS = [
  'All Trips',
  'Active Trips',
  'Pending Trips',
  // Nash, 2026-09-09: "We don't have a tab in there for completed trips… it
  // should be all trips, active, pending, and then history… Or we can call it
  // completed trips." Finished loads are reference material, so they get their
  // own tab and stay out of All Trips.
  'Completed Trips',
  'Needs Review',
  // Nash, 2026-09-09: "My contacts — instead of Fleet, should we have their
  // drivers?" He rejected unit history for this tab in the same breath, so it
  // holds the people a dispatcher works with (Task 98).
  'Drivers',
  'Reports',
  // Nash, 2026-09-19: the carrier company connected to this dispatcher —
  // verification status, company profile, and (for a Company Admin)
  // dispatcher approvals. Same dashboard, one more tab.
  'Company Info',
] as const
export type Tab = (typeof TABS)[number]

/** `?tab=company-info` deep link (status chip, emails) → tab name. */
export function tabFromSlug(slug: string | undefined): Tab | null {
  if (!slug) return null
  return TABS.find((t) => t.toLowerCase().replace(/\s+/g, '-') === slug.toLowerCase()) ?? null
}
