export type BlockType = 'amazon_products' | 'map_places' | 'x_posts' | 'youtube_videos';

export interface StructuredBlock {
  refId: string;
  type: BlockType;
  title: string;
  data: AmazonData | MapData | XPostData | YouTubeData;
}

export interface AmazonData {
  query: string;
  products: AmazonProduct[];
}

export interface AmazonProduct {
  asin: string;
  title: string;
  price?: string;
  rating?: number;
  reviewCount?: number;
  imageUrl?: string;
  productUrl: string;
  keepaGraphUrl: string;
  keepaDetailUrl: string;
}

export interface MapPlaceItem {
  name: string;
  address: string;
  lat: number;
  lon: number;
  type: string;
  details: string;
  mapUrl: string;
}

export interface MapData {
  query: string;
  places: MapPlaceItem[];
}

export interface XPostItem {
  id: string;
  text: string;
  authorName: string;
  authorScreenName: string;
  authorImageUrl: string;
  likes: number;
  retweets: number;
  replies: number;
  views: number;
  createdAt: string;
  postUrl: string;
}

export interface XPostData {
  query: string;
  posts: XPostItem[];
}

export interface YouTubeVideoItem {
  videoId: string;
  title: string;
  channelName: string;
  thumbnailUrl: string;
  videoUrl: string;
  viewCount: string;
  publishedAt: string;
  duration: string;
  description: string;
}

export interface YouTubeData {
  query: string;
  videos: YouTubeVideoItem[];
}
