import { ProjectMapExplorer, type ProjectItem } from "@/components/ProjectMapExplorer";
import seedData from "@/data/project-data.json";
import { getCityHref, projectRegions, readProjectStore, type ProjectStore } from "@/lib/projectStore";
import type { Metadata } from "next";

export const metadata: Metadata = {
  title: "Makkah Projects | Alawaly Rise",
  description: "Explore Alawaly hospitality and residential projects in Makkah Al-Mukarramah",
};

const makkahProjects: ProjectItem[] = [
  {
    id: "makkah-sanctuary",
    category: "mosque",
    nameEn: "Alawaly Haram Sanctuary",
    nameAr: "ملاذ العوالي بجوار الحرم",
    typeEn: "Five-Star Hospitality & Residences",
    typeAr: "ضيافة ومساكن خمس نجوم",
    statusEn: "Under Development",
    statusAr: "قيد التطوير",
    locationEn: "Central Zone, Makkah",
    locationAr: "المنطقة المركزية، مكة المكرمة",
    descriptionEn:
      "A serene spiritual retreat offering bespoke pilgrim services, direct pedestrian prayer concourses, and world-class luxury accommodations.",
    descriptionAr:
      "ملاذ روحي هادئ يقدم خدمات ضيافة مخصصة وممرات مشاة مباشرة إلى ساحات الحرم المكي الشريف.",
  },
  {
    id: "makkah-gardens",
    category: "garden",
    nameEn: "Alawaly Pilgrim Gardens",
    nameAr: "حدائق العوالي للزوار",
    typeEn: "Hospitality Residences",
    typeAr: "مساكن ضيافة",
    statusEn: "Upcoming",
    statusAr: "قريباً",
    locationEn: "Makkah",
    locationAr: "مكة المكرمة",
    descriptionEn:
      "A welcoming residential concept with shaded gardens, family services, and comfortable short-stay suites.",
    descriptionAr:
      "تصور سكني يضم حدائق مظللة وخدمات عائلية وأجنحة مريحة للإقامات القصيرة.",
  },
  {
    id: "makkah-transit",
    category: "landmark",
    nameEn: "Makkah Gateway",
    nameAr: "بوابة مكة",
    typeEn: "Urban and Mobility Hub",
    typeAr: "مركز حضري ونقل",
    statusEn: "Under Development",
    statusAr: "قيد التطوير",
    locationEn: "Makkah Transit District",
    locationAr: "منطقة النقل في مكة",
    descriptionEn:
      "A mixed-use gateway concept connecting visitor services, local retail, and convenient transport links.",
    descriptionAr:
      "تصور لوجهة متعددة الاستخدامات تربط خدمات الزوار بالمتاجر المحلية ووسائل النقل الميسرة.",
  },
  {
    id: "makkah-community",
    category: "mall",
    nameEn: "Makkah Community Quarter",
    nameAr: "حي مكة المجتمعي",
    typeEn: "Community and Retail",
    typeAr: "مجتمع سكني ومتاجر",
    statusEn: "Concept Preview",
    statusAr: "تصميم تجريبي",
    locationEn: "Makkah",
    locationAr: "مكة المكرمة",
    descriptionEn:
      "A design preview for a neighborhood with local shops, shared courtyards, and everyday community services.",
    descriptionAr:
      "تصور لحي يضم متاجر محلية وساحات مشتركة وخدمات مجتمعية يومية.",
  },
  {
    id: "makkah-learning-center",
    category: "education",
    nameEn: "Makkah Learning Center",
    nameAr: "مركز مكة للتعلم",
    typeEn: "Education and Community",
    typeAr: "تعليم ومجتمع",
    statusEn: "Concept Preview",
    statusAr: "تصميم تجريبي",
    locationEn: "Makkah",
    locationAr: "مكة المكرمة",
    descriptionEn:
      "A learning campus concept with flexible classrooms, family programs, and community facilities.",
    descriptionAr:
      "تصور لمجمع تعليمي يضم فصولاً مرنة وبرامج أسرية ومرافق مجتمعية.",
  },
  {
    id: "makkah-wellness",
    category: "health",
    nameEn: "Makkah Wellness Center",
    nameAr: "مركز مكة للعافية",
    typeEn: "Health and Wellness",
    typeAr: "صحة وعافية",
    statusEn: "Concept Preview",
    statusAr: "تصميم تجريبي",
    locationEn: "Makkah",
    locationAr: "مكة المكرمة",
    descriptionEn:
      "A convenient healthcare destination for residents and visitors with clinics and wellness services.",
    descriptionAr:
      "وجهة رعاية صحية ميسرة للسكان والزوار تضم عيادات وخدمات للعافية.",
  },
];

export const dynamic = "force-dynamic";
const defaultStore = seedData as ProjectStore;

export default async function MakkahProjectsPage() {
  const store = await readProjectStore(defaultStore);
  const cityData = store.cities.find((city) => city.id === "makkah") ?? defaultStore.cities[2];
  const region = projectRegions.find((item) => item.id === cityData.regionId)!;

  return (
    <ProjectMapExplorer
      cityNameEn={cityData.nameEn}
      cityNameAr={cityData.nameAr}
      regionEn={region.nameEn}
      regionAr={region.nameAr}
      dayImage={cityData.dayImage}
      nightImage={cityData.nightImage}
      projects={cityData.projects}
      cityLinks={store.cities.map((city) => ({
        nameEn: city.nameEn,
        nameAr: city.nameAr,
        href: getCityHref(city.id),
      }))}
    />
  );
}
