/**
 * Platform Content Types
 *
 * Typed interfaces for platform-specific content stored in the
 * `platform_content` JSONB column of `acq_content_distributions`.
 */

// =============================================================================
// Base
// =============================================================================

/** Fields shared across all platforms */
export interface PlatformContent {
  title?: string
  description?: string
  tags?: string[]
}

// =============================================================================
// Platform Extensions
// =============================================================================

export interface YouTubeContent extends PlatformContent {
  timestamps?: string[]
  endScreenVideoId?: string
  pinnedComment?: string
}

export interface LinkedInContent extends PlatformContent {
  hook?: string
  hashtags?: string[]
  firstComment?: string
}

export interface InstagramContent extends PlatformContent {
  altText?: string
  hashtags?: string[]
  storyLink?: string
}

export interface XContent extends PlatformContent {
  hookTweet?: string
  threadTweets?: string[]
  replyThread?: string
}

// =============================================================================
// Union & Helpers
// =============================================================================

export type AnyPlatformContent = YouTubeContent | LinkedInContent | InstagramContent | XContent

/** Map platform string to its content type */
export interface PlatformContentMap {
  youtube: YouTubeContent
  linkedin: LinkedInContent
  instagram: InstagramContent
  x: XContent
}

export type Platform = keyof PlatformContentMap
