export interface ILesson {
  Link: string;
  Title: string;
  Type: string;
  Content: string;
  Recording?: string;
  Questions?: IQuestion[];
}

export interface IQuestion {
  Question: string;
  Options: IOption[];
}

export interface IOption {
  Option: string;
  IsCorrect?: boolean;
}

export interface IValueLabel {
  label: string;
  value: string;
}

export interface IChapter {
  Name: string;
  Lessons: ILesson[];
}

export interface ICourse {
  Type: string;
  Name: string;
  Price: string;
  "Instructor name": string;
  "Instructor dp": string;
  overview: string;
  "Objectives and Syllabus": string;
  Certificate: string;
  Cover: string;
  Title: string;
}
//CmsItem<ICourse, any>

export interface CmsItem<T, U> {
  id: number;
  table_id: string;
  data: T;
  metadata: U;
  created_at?: string;
  title: string;
  description: string;
  long_description: string;
  slug: string;
  link?: string;
  parent_id: string;
  parent_parent_id: string;
  children?: CmsItem<any, any>[];
}

export function initCmsItem<T, M>(
  data: T,
  meta: M,
  title: string,
  parent_id: string,
  parent_parent_id: string
): CmsItem<T, M> {
  return {
    description: '',
    title: title,
    id: 0,
    long_description: '',
    metadata: meta,
    parent_id: parent_id,
    parent_parent_id: parent_parent_id,
    slug: '',
    table_id: '',
    data: data,
  };
}