/**
 * How the calendar maps an entry's API type onto a detail route and a label.
 *
 * Two vocabularies reach the calendar: the specific English type labels the
 * listing endpoints return, and the coarse `Volunteer` / `Learn` / `Event`
 * grouping the calendar endpoint uses. Both resolve through
 * `detailPathForType`, which is why the coarse names are checked first.
 */

/** Detail route for an entry, keyed on the API's English type label. */
export const DETAIL_PATH_BY_TYPE: Record<string, string> = {
  Opportunity: "/volunteer-event-detail",
  "Class/Workshop": "/learn-share-event-detail",
  Internship: "/learn-share-event-detail",
  Course: "/learn-share-event-detail",
  Consultation: "/learn-share-event-detail",
  "Exhibition and Carnivals": "/event-details",
  Camps: "/event-details",
  Hub: "/event-details",
  "Sports Activities": "/event-details",
};

export const LEARN_SERVE_TYPES = [
  "Class/Workshop",
  "Internship",
  "Course",
  "Consultation",
];
export const EVENT_TYPES = [
  "Exhibition and Carnivals",
  "Camps",
  "Hub",
  "Sports Activities",
];

export const GENERIC_TYPE_LABELS: Record<string, { en: string; ar: string }> = {
  Volunteer: { en: "Volunteer opportunity", ar: "فرصة تطوعية" },
  Learn: { en: "Learn and serve", ar: "تعلّم وخدمة" },
  Event: { en: "Event", ar: "فعالية" },
};

export const detailPathForType = (type: string) => {
  if (type === "Volunteer") return "/volunteer-event-detail";
  if (type === "Learn") return "/learn-share-event-detail";
  if (type === "Event") return "/event-details";
  return DETAIL_PATH_BY_TYPE[type];
};
