import { PhotoAttachment } from './photos';

// Social post type definitions (aligned with Rails SocialPostSerializer)
export interface SocialPost {
  id: number;
  platform: string;
  content_markdown: string;
  posted_at: string;
  status?: string;
  created_at: string;
  updated_at: string;
  /** Image URLs from photo_attachments (preferred for display) */
  image_urls?: string[];
  /** Photo attachments (same pattern as blog post, team member, etc.) */
  photo_attachments?: PhotoAttachment[];
  /** Legacy; prefer image_urls / photo_attachments */
  media_urls?: {
    images?: string[];
    videos?: string[];
  };
  engagement_metrics?: {
    likes?: number;
    comments?: number;
    shares?: number;
    views?: number;
  };
  /** Permalink to the post on the platform when available; only link when present to avoid broken links */
  external_post_url?: string | null;
}

export interface SocialPostParams {
  platform?: string;
  featured?: boolean;
  page?: number;
  per_page?: number;
}

export type SocialPostResponse = SocialPost[];
