import { request, BASE } from "./client";

// ── Types ────────────────────────────────────────────────────────────────────

export interface CreatorDashboardTechnique {
  title: string;
  slug: string;
  topic_category: string;
  created_at: string;
  key_moment_count: number;
}

export interface CreatorDashboardVideo {
  filename: string;
  processing_status: string;
  created_at: string;
}

export interface CreatorDashboardResponse {
  video_count: number;
  technique_count: number;
  key_moment_count: number;
  search_impressions: number;
  techniques: CreatorDashboardTechnique[];
  videos: CreatorDashboardVideo[];
}

// ── Functions ────────────────────────────────────────────────────────────────

export async function fetchCreatorDashboard(): Promise<CreatorDashboardResponse> {
  return request<CreatorDashboardResponse>(`${BASE}/creator/dashboard`);
}
