export type ItineraryDestination = {
  key: string;
  destinationId: string;
  slug: string;
  contentOptions: { value: string; label: string }[];
};

const ITINERARY_DESTINATIONS: ItineraryDestination[] = [
  {
    key: "fushi",
    destinationId: "26",
    slug: "karma-fushi",
    contentOptions: [
      { value: "8b19d47e-f068-446e-b510-87b0f1d2032f", label: "South Male" },
      { value: "c3660d17-bc0e-4671-93e9-8e0fa8c0d158", label: "North Male" },
      { value: "79c7d745-61fd-4233-ae22-f32b1c65a479", label: "Baa Atoll" },
    ],
  },
  {
    key: "karnak",
    destinationId: "2",
    slug: "karma-karnak",
    contentOptions: [
      { value: "73adae6c-45d7-46d7-b102-7bc10dd22de2", label: "Luxor to Aswan (4N/5D)" },
      { value: "b89742b7-a570-4a7b-b8c8-dd7adb41cdc0", label: "Aswan to Luxor (3N/4D)" },
    ],
  },
];

export function findItineraryDestination(resort: {
  code?: string | null;
  name?: string | null;
}): ItineraryDestination | undefined {
  const haystack = `${resort.code ?? ""} ${resort.name ?? ""}`.toLowerCase();
  return ITINERARY_DESTINATIONS.find((d) => haystack.includes(d.key));
}
