// import LessonCategoriesProps from '../interfaces/LessonCategoriesProps';
// import LessonContentProps from '../interfaces/LessonContentProps';

async function listConectivesRevisionContent(): Promise<any[]> {
  return fetch('/data/Quiz/ConnectivesRevision/content.json').then(res => {
    return res.json();
  });
}

async function listMatchingFrenzyContent(): Promise<any[]> {
  return fetch('/data/Quiz/MatchingFrenzy/content.json').then(res => {
    return res.json();
  });
}

async function listQuizListeningPracticeContent(): Promise<any[]> {
  return fetch('/data/Quiz/ListeningPractice/content.json').then(res => {
    return res.json();
  });
}

async function listLessonContent(): Promise<any[]> {
  return fetch('/data/Lesson/content.json').then(res => {
    return res.json();
  });
}

function listLessonCategories(): Promise<any[]> {
  return listLessonContent().then((res_json: any) => {
    return res_json.map((lesson: any) => {
      return { name: lesson.name, path: lesson.path, content: lesson.content };
    });
  });
}

function Helloworld(): Promise<any[]> {
  return listLessonContent();
}

export {
  listConectivesRevisionContent,
  listMatchingFrenzyContent,
  listLessonContent,
  listLessonCategories,
  listQuizListeningPracticeContent,
  //
  Helloworld
};
