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: "Riyadh Projects | Alawaly Rise",
  description: "Explore Alawaly real estate development projects in Riyadh",
};

const riyadhProjects: ProjectItem[] = [
  {
    id: "riyadh-tower-1",
    category: "landmark",
    nameEn: "Alawaly Landmark Tower",
    nameAr: "برج العوالي لاندبارك",
    typeEn: "Mixed-Use Luxury Tower",
    typeAr: "برج فاخر متعدد الاستخدامات",
    statusEn: "Under Development",
    statusAr: "قيد التطوير",
    locationEn: "King Fahd Road, Riyadh",
    locationAr: "طريق الملك فهد، الرياض",
    descriptionEn:
      "A flagship architectural landmark blending luxury residences, premium commercial suites, and bespoke lifestyle amenities in the heart of the capital.",
    descriptionAr:
      "معلم معماري رائد يجمع بين المساكن الفاخرة والأجنحة التجارية المتميزة ومرافق الرفاهية في قلب العاصمة.",
  },
  {
    id: "riyadh-residences",
    category: "garden",
    nameEn: "Alawaly Heights",
    nameAr: "عوالي هايتس",
    typeEn: "Ultra-Luxury Residential",
    typeAr: "مجمع سكني فائق الفخامة",
    statusEn: "Upcoming",
    statusAr: "قريباً",
    locationEn: "North Riyadh",
    locationAr: "شمال الرياض",
    descriptionEn:
      "Exclusive private estates with panoramic skyline views, bespoke concierge services, and verdant private grounds.",
    descriptionAr:
      "مساكن خاصة حصرية بإطلالات بانورامية على أفق المدينة، وخدمات كونسيرج مخصصة وحدائق غنّاء.",
  },
  {
    id: "riyadh-gardens",
    category: "garden",
    nameEn: "Alawaly Gardens",
    nameAr: "حدائق العوالي",
    typeEn: "Community Residences",
    typeAr: "مجمع سكني متكامل",
    statusEn: "Upcoming",
    statusAr: "قريباً",
    locationEn: "North Riyadh",
    locationAr: "شمال الرياض",
    descriptionEn:
      "A walkable residential community with landscaped courtyards, family amenities, and neighborhood retail.",
    descriptionAr:
      "مجتمع سكني قابل للمشي يضم ساحات خضراء ومرافق عائلية ومتاجر تخدم الحي.",
  },
  {
    id: "riyadh-business-quarter",
    category: "mall",
    nameEn: "Riyadh Business Quarter",
    nameAr: "حي الرياض للأعمال",
    typeEn: "Commercial District",
    typeAr: "منطقة تجارية",
    statusEn: "Under Development",
    statusAr: "قيد التطوير",
    locationEn: "King Abdullah Financial District",
    locationAr: "مركز الملك عبدالله المالي",
    descriptionEn:
      "A contemporary destination for offices, dining, and flexible workspaces in a connected urban setting.",
    descriptionAr:
      "وجهة عصرية للمكاتب والمطاعم ومساحات العمل المرنة ضمن بيئة حضرية مترابطة.",
  },
  {
    id: "riyadh-cultural-park",
    category: "education",
    nameEn: "Wadi View Cultural Park",
    nameAr: "حديقة وادي فيو الثقافية",
    typeEn: "Cultural and Leisure",
    typeAr: "وجهة ثقافية وترفيهية",
    statusEn: "Concept Preview",
    statusAr: "تصميم تجريبي",
    locationEn: "Wadi Hanifah, Riyadh",
    locationAr: "وادي حنيفة، الرياض",
    descriptionEn:
      "A concept for a public park connecting cultural venues, walking trails, and outdoor gathering spaces.",
    descriptionAr:
      "تصور لحديقة عامة تربط بين الوجهات الثقافية ومسارات المشي ومساحات التجمع المفتوحة.",
  },
  {
    id: "riyadh-wellness-center",
    category: "health",
    nameEn: "Alawaly Wellness Center",
    nameAr: "مركز العوالي الصحي",
    typeEn: "Healthcare and Wellness",
    typeAr: "رعاية صحية وعافية",
    statusEn: "Concept Preview",
    statusAr: "تصميم تجريبي",
    locationEn: "North Riyadh",
    locationAr: "شمال الرياض",
    descriptionEn:
      "A neighborhood health destination combining clinics, wellness services, and family support facilities.",
    descriptionAr:
      "وجهة صحية للحي تجمع بين العيادات وخدمات العافية ومرافق دعم الأسرة.",
  },
  {
    id: "riyadh-grand-mosque",
    category: "mosque",
    nameEn: "Alawaly Grand Mosque",
    nameAr: "مسجد العوالي الكبير",
    typeEn: "Community Mosque",
    typeAr: "مسجد مجتمعي",
    statusEn: "Concept Preview",
    statusAr: "تصميم تجريبي",
    locationEn: "Central Riyadh",
    locationAr: "وسط الرياض",
    descriptionEn:
      "A community landmark concept with a prayer hall, shaded courtyards, and neighborhood services.",
    descriptionAr:
      "تصور لمعْلم مجتمعي يضم مصلى وساحات مظللة وخدمات للحي.",
  },
];

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

export default async function RiyadhProjectsPage() {
  const store = await readProjectStore(defaultStore);
  const cityData = store.cities.find((city) => city.id === "riyadh") ?? defaultStore.cities[0];
  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),
      }))}
    />
  );
}
