/* ─────────────────────────────────────────────────────────────────────────────
   Shared ContentItem — used by History, Liked, Watch-Later
───────────────────────────────────────────────────────────────────────────── */

export interface RawContentItem {
  id: number;
  content_type: number;
  title: string;
  description?: string;
  portrait_img: string;
  landscape_img: string;
  content: string;
  content_upload_type: string;
  content_duration: number;
  is_rent: number;
  is_comment: number;
  is_download: number;
  is_like: number;
  total_view: number;
  total_like: number;
  total_dislike: number;
  total_watch_time?: string;
  status: number;
  created_at: string;
  updated_at?: string;
  user_id: number;
  channel_id?: string;
  channel_name: string;
  channel_image: string;
  category_name: string;
  language_name: string;
  is_subscribe: number;
  total_comment: number;
  is_user_like_dislike: number;
  total_subscriber: number;
  stop_time?: number;
  is_buy: number;
  episode?: unknown[];
  /* watch-later may omit these */
  rent_price?: number;
}

export interface ContentApiResponse {
  status: number;
  message: string;
  result: RawContentItem[];
  total_rows: number;
  total_page: number;
  current_page: number;
  more_page: boolean;
}

export interface ContentItem {
  id: string;
  contentType: number;
  title: string;
  description: string;
  thumbnail: string;   // landscape_img
  portraitImg: string; // portrait_img (for reels)
  videoUrl: string;    // raw content URL
  duration: string;
  durationMs: number;
  views: string;
  likes: string;
  dislikes: string;
  uploadedAt: string;
  channelName: string;
  channelImage?: string;
  channelId: string;
  channelUserId: string;
  category: string;
  language: string;
  isDownload: boolean;
  isPremium: boolean;
  stopTime: number;
  progressPct: number; // 0-100, computed
  totalComments: number;
  totalSubscribers: string;
  isSubscribed: boolean;
  isLive: boolean;
}
