import { getExercice } from '$lib/exercices';
import { getExerciceQA } from '$lib/qa.js';

/** @type {import('./$types').PageLoad} */
export async function load({ depends, params, parent }) {
  const { theme } = await parent();

  const exercice = getExercice(params.eid)
  depends(`api/exercices/${params.eid}`);

  const qaitems = getExerciceQA(params.eid);
  depends(`api/exercices/${params.eid}/qa`);

  return { exercice, qaitems, theme };
}
