import { z } from 'zod'

/**
 * Single source of truth for all active theme preset names.
 *
 * This is the canonical list. To add a preset:
 *   1. Add the name here.
 *   2. Create `packages/ui/src/theme/presets/{name}.ts` exporting `{name}Preset: ThemePreset`.
 *   3. Add to `PRESETS` record in `packages/ui/src/theme/presets/index.ts`.
 *   4. Add to `PresetName` union in `packages/ui/src/theme/presets/types.ts`.
 *   5. Add a card in `apps/command-center/src/features/settings/appearance/components/AppearanceSettings.tsx`.
 *
 * The union type (`ThemePresetName`) and Zod enum (`ThemePresetEnum`) are derived
 * automatically — no other files need updating.
 */
export const THEME_PRESETS = [
  'default',
  'tactical',
  'regal',
  'cyber-volt',
  'aurora',
  'rose-gold',
  'midnight',
  'titanium',
  'canopy',
  'slate',
  'cyber-strike',
  'cyber-chrome',
  'cyber-void',
  'nirvana',
  'wave',
  'synapse',
  'cortex',
  'helios',
  'graphite',
  'quarry'
] as const satisfies readonly string[]

export type ThemePresetName = (typeof THEME_PRESETS)[number]

/**
 * Zod enum derived from THEME_PRESETS.
 * Use `.catch('default')` at write-path callsites to tolerate stale/unknown values.
 */
export const ThemePresetEnum = z.enum(THEME_PRESETS)
