/**
 * HudView - Heads-up display with presets
 * DD §13.2. HUD presets: Full/Essential/Minimal.
 * Reference: claude-hud pattern (behavioral, no code reuse).
 *
 * @module packages/tui/src/components/HudView
 */

export type HudPreset = 'full' | 'essential' | 'minimal'

export interface HudViewProps {
  preset: HudPreset
  session_status: string
  task_count: number
  running_agents: number
  token_usage?: { current: number; max: number }
}

export function HudView({ preset, session_status, task_count, running_agents, token_usage }: HudViewProps): string {
  const status_icon = session_status === 'active' ? '🟢' : '🟡'

  const components: string[] = []

  if (preset === 'full' || preset === 'essential') {
    components.push(`${status_icon} ${session_status}`)
    components.push(`Tasks: ${task_count}`)
    components.push(`Agents: ${running_agents}`)
  }

  if (preset === 'full') {
    if (token_usage) {
      const pct = Math.round((token_usage.current / token_usage.max) * 100)
      components.push(`Tokens: ${token_usage.current}/${token_usage.max} (${pct}%)`)
    }
  }

  if (preset === 'minimal') {
    components.push(`${status_icon}`)
  }

  return components.join(' │ ')
}
