export type ContentSource = "youtube" | "instagram" | "podcast";

export type ContentMetrics = {
  views?: number;
};

export type ContentItem = {
  id: string;
  source: ContentSource;
  url: string;
  title: string;
  summary?: string;
  publishedAt: string; // ISO-8601
  thumbnailUrl?: string;
  audioUrl?: string;
  metrics?: ContentMetrics;
};

export type ContentCache = {
  generatedAt: string; // ISO-8601
  items: ContentItem[];
  wordpress?: WordpressContent;
};

export type WordpressKind = "post" | "page";

export type WordpressCategory = {
  id: number;
  slug: string;
  name: string;
};

export type WordpressBase = {
  id: string;
  kind: WordpressKind;
  slug: string;
  url: string;
  title: string;
  excerpt: string;
  contentHtml: string;
  featuredImageUrl?: string;
  publishedAt: string; // ISO-8601
  updatedAt: string; // ISO-8601
};

export type WordpressPost = WordpressBase & {
  kind: "post";
  categoryIds: number[];
};

export type WordpressPage = WordpressBase & {
  kind: "page";
};

export type WordpressContent = {
  posts: WordpressPost[];
  pages: WordpressPage[];
  categories: WordpressCategory[];
};
