/**
 * SAMPLE internal state knowledge for the state-info panel (Task 12).
 * The real content comes from the internal state-data backend later —
 * this exists so the panel's design can be reviewed with realistic text.
 */

export const STATE_INFO_TOPICS = [
  'Travel info',
  'Escort info',
  'Permit limits',
  'Legal limits',
  'Signs & more',
  'Superloads',
] as const

export type StateInfoTopic = (typeof STATE_INFO_TOPICS)[number]

type StateInfo = Record<StateInfoTopic, string>

const GENERIC: StateInfo = {
  'Travel info':
    'Travel is generally permitted from half an hour before sunrise to half an hour after sunset, Monday through Saturday. Metro-area curfews and holiday restrictions may apply — always confirm against the permit and provisions for this load.',
  'Escort info':
    'Escort requirements scale with dimensions and road type. Loads over the width threshold typically need one escort on divided highways and front and rear escorts on two-lane roads. A height pole is required over the height threshold.',
  'Permit limits':
    'Routine permits are typically issued up to common maximums for width, height, length, and gross weight. Anything above routine limits needs additional review time and may carry route restrictions.',
  'Legal limits':
    "Legal (no-permit) limits generally follow 8'6\" width, 13'6\" height, and 80,000 lbs gross. Anything above these requires an oversize/overweight permit before movement.",
  'Signs & more':
    'Oversize Load signs front and rear, red flags on all extremities, and functioning amber beacons are commonly required while operating under permit. Specific flag/sign/light rules are listed in the state provisions.',
  Superloads:
    'Loads exceeding superload thresholds require extended review, often a route survey, and sometimes police escorts. Processing times are significantly longer — plan ahead.',
}

const PER_STATE: Record<string, Partial<StateInfo>> = {
  WA: {
    'Travel info':
      'Washington: daylight travel; no travel on major holidays. Seattle/Tacoma metro movement is restricted during weekday peak hours. Weekend travel allowed for loads within routine dimensions.',
    'Escort info':
      "Washington: one escort typically required over 11' wide on multilane highways; front and rear escorts on two-lane roads over 11'. Height pole required over 14'6\".",
  },
  CO: {
    'Travel info':
      'Colorado: travel allowed sunrise to sunset; Denver metro curfews on weekdays 7:00–9:00 AM and 4:00–6:00 PM. Chain law periods can restrict oversize movement on mountain corridors.',
    Superloads:
      'Colorado: superload review applies over 200,000 lbs GVW or extreme dimensions; expect route surveys on mountain passes.',
  },
  GA: {
    'Travel info':
      'Georgia: travel permitted 30 minutes before sunrise to 30 minutes after sunset. No movement through the Atlanta metro during weekday rush hours. Sunday travel restricted for some dimension classes.',
    'Escort info':
      "Georgia: escorts generally required over 12' wide; front escort on two-lane roads, rear escort on divided highways.",
  },
}

export function getStateInfo(code: string): StateInfo {
  const overrides = PER_STATE[code.toUpperCase()] ?? {}
  return { ...GENERIC, ...overrides }
}
