import { string } from "zod";
import { TImageUrls } from "./Image";
import { TSEO } from "./Seo";

// article detail and press release detail
export interface TThumbnailSection {
    type: "thumbnail";
    data: TThumbnailData;
}

export type TContentItem = TThumbnailSection;

export interface TThumbnailData {
    image: number | string;
    content: string;
    urls: TImageUrls;
    image_preview: string;
    alt_text: string | null;
    name: string | null;
    press_category: TArticlePressCategory | null;
    article_category: TArticlePressCategory | null;
}

export interface TPressRelease {
    id: number;
    name: string;
    slug: string;
    press_category_id: number;
    author_id: number;
    content: TContentItem[];
    press_tags: string[];
    published_at: string;
    created_at: string;
    updated_at: string;
    author: TAuthor;
    press_category: TArticlePressCategory | null;
    article_category: TArticlePressCategory | null;
    seo: TSEO;
    content_type?: string;
}

export interface TArticle {
    id: number;
    name: string;
    slug: string;
    article_category_id: number;
    author_id: number;
    content: TContentItem[];
    article_tags: string[];
    published_at: string;
    created_at: string;
    updated_at: string;
    author: TAuthor;
    article_category: TArticlePressCategory | null;
    press_category: TArticlePressCategory | null;
    seo: TSEO;
    content_type?: string;
}

export interface TArticlePressCategory {
    id: number;
    name: string;
    slug: string;
    color?: string;
    created_at: string;
    updated_at: string;
}

export interface TAuthor {
    id: number;
    name: string;
    slug: string;
    created_at: string;
    updated_at: string;
}

export interface TPage {
    id: number;
    name: string;
    slug: string;
    content: [TContentSection];
    seo: TSEO;
}

export interface TPageNewsDetail {
    id: number;
    name: string;
    slug: string;
    content: [
        {
            type: "section_detail";
            data: TNewsDetailData;
        }
    ];
    seo: TSEO;
}

export interface TPagePressRelease {
    id: number;
    name: string;
    slug: string;
    content: TThumbnailData[];
    seo: TSEO;
}

export interface TMainBannerSection {
    type: "section_main_banner";
    data: TMainBannerData;
}

export interface TContentSection {
    type: "section_news";
    data: TContentArticle;
}

export interface TNewsDetailData {}

export interface TMainBannerData {
    title: string;
    subtitle: string;
    image: number;
    urls: TImageUrls;
    image_preview: string;
    alt_text: string | null;
}

export interface TContentPressRelease {
    title_news: string;
    title_gallery: string;
    search_placeholder: string;
    highlight: string;
}

export interface TContentArticle {
    title_news: string;
    search_placeholder: string;
    highlight: string;
}

export interface TPaginationMeta {
    total: number;
    current_page: number;
    last_page: number;
    per_page: number;
    first_page_url: string | null;
    next_page_url: string | null;
    prev_page_url: string | null;
    last_page_url: string | null;
}
