// Tab definitions
export type TabId = 'editor' | 'units' | 'sessions' | 'analytics' | 'content'

export interface Tab {
  id: TabId
  label: string
  icon: React.ReactNode
}

// Type definitions
export interface BridgeStatus {
  status: string
  unity_version: string
  project: string
  scene: string
  is_playing: boolean
  is_compiling: boolean
  errors: number
  warnings: number
}

// Unit System types
export interface UnitDefinition {
  unit_id: string
  template: string
  version: string
  locale: string[]
  grade_band: string[]
  duration_minutes: number
  difficulty: string
  subject?: string
  topic?: string
  learning_objectives?: string[]
  stops?: UnitStop[]
}

export interface UnitStop {
  stop_id: string
  order: number
  label: { [key: string]: string }
  interaction?: {
    type: string
    params?: Record<string, unknown>
  }
}

export interface AnalyticsOverview {
  time_range: string
  total_sessions: number
  unique_students: number
  avg_completion_rate: number
  avg_learning_gain: number | null
  most_played_units: Array<{ unit_id: string; count: number }>
  struggling_concepts: Array<{ concept: string; count: number }>
  active_classes: number
}

export interface GeneratedContent {
  unit_id: string
  locale: string
  generated_count?: number
  html?: string
  title?: string
}

export interface LogEntry {
  time: string
  type: string
  message: string
  frame: number
  stack?: string
}

export interface LogsResponse {
  count: number
  total_errors: number
  total_warnings: number
  total_info: number
  logs: LogEntry[]
}

export interface DiagnosticEntry {
  category: string
  severity: 'ok' | 'warning' | 'error'
  message: string
}

export interface DiagnoseResponse {
  diagnostics: DiagnosticEntry[]
  errors: number
  warnings: number
}
