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 (
{displayDescription}
{house.apartments.length} {locale === "de" ? "Apartments" : "Apartments"}
{locale === "de" ? "Adresse:" : "Address:"} {house.address}
{locale === "de" ? "Stadt:" : "City:"} {house.zipCode} {house.city}
{locale === "de" ? "Panzer Kaserne – gleiche Straße" : "Panzer Kaserne – Same Street"}
{locale === "de" ? "Kein Abbiegen nötig" : "Zero turns needed"}
{locale === "de" ? "Stadtzentrum Böblingen" : "Böblingen City Center"}
5–8 min
{locale === "de" ? "Daimler Werk Sindelfingen" : "Daimler Plant Sindelfingen"}
10–15 min
{locale === "de" ? "Stadtzentrum Böblingen" : "Böblingen City Center"}
< 5 min
{locale === "de" ? "Karte ist interaktiv – klicken Sie auf einen Ort, um die Route zu planen." : "Map is interactive – click a destination to plan the route."}