import { notFound } from "next/navigation"; import { useTranslations } from "next-intl"; import { getTranslations } from "next-intl/server"; import { getHouseBySlug } from "@/src/config/apartments"; import { ApartmentCard } from "@/components/ui/ApartmentCard"; import { HouseHighlights } from "@/components/ui/HouseHighlights"; import { MapPin, Home, Car, Clock, Navigation } from "lucide-react"; import Image from "next/image"; export async function generateMetadata({ params: { locale, houseSlug }, }: { params: { locale: string; houseSlug: string }; }) { const house = getHouseBySlug(houseSlug); if (!house) return { title: "Not Found" }; const t = await getTranslations({ locale, namespace: "metadata" }); return { title: `${house.nameEn} - ${t("title")}`, description: house.descriptionEn, }; } export default function HousePage({ params: { locale, houseSlug }, }: { params: { locale: string; houseSlug: string }; }) { const t = useTranslations("houses"); const house = getHouseBySlug(houseSlug); if (!house) notFound(); const displayName = locale === "de" ? house.name : house.nameEn; const displayDescription = locale === "de" ? house.description : house.descriptionEn; const displayCountry = locale === "de" ? house.country : house.countryEn; return (
{displayName}

{displayName}

{house.address}, {house.zipCode} {house.city}, {displayCountry}

{t("overview")}

{displayDescription}

{t("apartments")}

{house.apartments.map((apartment) => ( ))}

{displayName}

{house.apartments.length} {locale === "de" ? "Apartments" : "Apartments"}

{locale === "de" ? "Adresse:" : "Address:"} {house.address}

{locale === "de" ? "Stadt:" : "City:"} {house.zipCode} {house.city}

{locale === "de" ? "Lage & Entfernungen" : "Location & Distances"}