import { ImageObject } from '@/types/Common';

export interface CreationListItem {
  alkotasAzonosito: string;
  cardType: CreationCardType;
  fokep: string | null;
  fokepId: number | null;
  fokepNev: string | null;
  hivatkozas: string | null;
  id: number;
  koordinatak: string | null; // can be empty string
  label: string | null;
  labelYear: number | null;
  alkoto: CreationListItemCreator[];
  nev: string | null; // a few null cases
  telepules: string | null;

  // only news and life events
  cim?: {
    city?: string;
    country?: string;
  };
  kepek: ImageObject[];
  tipus?: string | null;
  tipusLabel?: string;
  hivatkozasLista: CreationVideoField[] | null;
}

export type CreationListItemCreator = {
  alkotoAzonosito: string;
  megjelenitendoNev: string;
  szakma: string | null;
  profilkep?: ImageObject | null;
};

export interface CreationVideoField {
  cim: string | null;
  hivatkozas: string | null;
  link: string | null;
  forrasa: string | null;
  sorozat: string | null;
  sorozatPozicio: number | null;
  leiras: string | null;
  tipus: string | null;
  status: VideoYoutubeStatus;
}

export type CreationCardType = 'creation' | 'life' | 'news';

export type CreatorTimelineCategory = 'alkotas' | 'eletut' | 'mma-hir' | 'alkotas-video';

export interface CreationPageItem {
  alkotasAzonosito: string;
  alkoto: CreationListItemCreator[];
  alkototars: Alkototars[] | null;
  attributumok: CreationPageAttribute[];
  fokep: ImageObject | null;
  hivatkozasLista: HivatkozasListaItem[] | null;
  keletkezesHelyeCity: string | null;
  keletkezesHelyeKoordinatak: string | null;
  label: string | null;
  leiras: string | null;
  nev: string;
  targyszo: TargyszoItem[] | null;
  tovabbiKepek: ImageObject[] | null;

  muveszetiAg: string | null;
  muveszetiAgEnum: string | null;

  nemForditottTartalom: true | null;
  gepiForditas: true | false | null; // leírásra vonatkozik

  elozo_kovetkezo: CreationPager | null;
}

export interface CreationPagerLink {
  alkotasAzonosito: string;
  nev: string;
  keletkezesKezdoIdopontja: string | null;
  keletkezesZaroIdopontja: string | null;
}

export interface CreationPager {
  // no prev / next field at all in case there is no data
  prev?: CreationPagerLink;
  next?: CreationPagerLink;
  cntAct?: string; // "22"
  cntMax?: string; // "99"
}

interface CreationPageAttribute {
  // todo: using only a few, shorten api response later or extend interface
  attributumErtek: string;
  id: number;
  attributumNeve: string;
}

interface HivatkozasListaItem {
  tipus: string;
  hivatkozas: string;
  forrasa: string | null;
  jogtulajdonos: string | null;
  status: VideoYoutubeStatus;
}

export interface TargyszoItem {
  id: number;
  nev: string;
  /** When `false`, the keyword is shown as a tag but omitted from the recommender tabs. */
  jelolt?: boolean;
}

interface Alkototars {
  azonosito: string;
  nev: string;
}

type VideoYoutubeStatus = 'public' | 'private' | 'unlisted' | null;
