export interface Participant {
  id: string;
  name: string;
  email: string;
  avatar?: string;
}

export interface TranscriptSegment {
  id: string;
  speakerId: string;
  speakerName: string;
  text: string;
  timestamp: number; // seconds from start
  confidence: number;
}

export interface ActionItem {
  id: string;
  text: string;
  assignee?: string;
  dueDate?: string;
  completed: boolean;
}

export interface Summary {
  overview: string;
  keyPoints: string[];
  decisions: string[];
  actionItems: ActionItem[];
  sentiment: "positive" | "neutral" | "negative";
}

export interface Meeting {
  id: string;
  title: string;
  date: string;
  duration: number;
  participants: Participant[];
  transcript: TranscriptSegment[];
  summary?: Summary;
  rawStatus?: string; // original API status string e.g. "transcript.done", "bot.in_call_recording"
  platform?: string;  // "google_meet" | "microsoft_teams" | "zoom" | "jitsi"
  participantNames?: string[]; // from participants_details.names
  // in_lobby     = bot waiting to join
  // live          = bot in meeting, actively recording
  // not_admitted  = host denied bot entry
  // processing    = meeting ended, transcription pending
  // completed     = transcription done
  // too_short     = meeting was too short to transcribe
  // abort         = user closed dialog without starting bot
  // failed        = something went wrong
  // pending       = recall.ai bot creation requested, not yet joined
  // bot_created   = recall.ai bot created, joining in progress
  status: "in_lobby" | "live" | "not_admitted" | "processing" | "completed" | "too_short" | "abort" | "failed" | "pending" | "bot_created" | "scheduled";
  meetLink?: string;
  appToggleEnabled?: boolean;
  recurringCandidateId?: number;
  statusSegment?: string;
  isRecurring?: boolean;
}

export type MeetingStatus = Meeting["status"];

// Helper — returns true for any status where bot is active
export function isMeetingActive(status: MeetingStatus): boolean {
  return status === "pending" || status === "bot_created" || status === "in_lobby" || status === "live";
}
