/**
 * Types and constants for the Unified Inbox Mail Admin Page
 */

// API Base URL for backend operations (accounts, sync, etc.)
export const API_BASE = process.env.NEXT_PUBLIC_KLAUSUR_SERVICE_URL || 'http://macmini:8086'

export interface EmailAccount {
  id: string
  email: string
  displayName: string
  imapHost: string
  imapPort: number
  smtpHost: string
  smtpPort: number
  status: 'active' | 'inactive' | 'error' | 'syncing'
  lastSync: string | null
  emailCount: number
  unreadCount: number
  createdAt: string
}

export interface MailStats {
  totalAccounts: number
  activeAccounts: number
  totalEmails: number
  unreadEmails: number
  totalTasks: number
  pendingTasks: number
  overdueTasks: number
  aiAnalyzedCount: number
  lastSyncTime: string | null
}

export interface SyncStatus {
  running: boolean
  accountsInProgress: string[]
  lastCompleted: string | null
  errors: string[]
}

export type TabId = 'overview' | 'accounts' | 'ai-settings' | 'templates' | 'logs'

export const tabs: { id: TabId; name: string }[] = [
  { id: 'overview', name: 'Uebersicht' },
  { id: 'accounts', name: 'Konten' },
  { id: 'ai-settings', name: 'KI-Einstellungen' },
  { id: 'templates', name: 'Vorlagen' },
  { id: 'logs', name: 'Audit-Log' },
]
