import Link from "next/link"; import Image from "next/image"; import { Apartment, House } from "@/src/config/apartments"; import { formatPrice } from "@/src/lib/pricing"; import { CheckCircle2, XCircle, Users, MapPin, ArrowRight } from "lucide-react"; import { useTranslations } from "next-intl"; interface AvailableApartmentCardProps { apartment: Apartment; house: House; locale: string; available: boolean; minStayValid: boolean; pricePerNight?: number; currency?: string; arrival: string; departure: string; } export function AvailableApartmentCard({ apartment, house, locale, available, minStayValid, pricePerNight, currency, arrival, departure, }: AvailableApartmentCardProps) { const t = useTranslations("houses.search"); const displayName = locale === "de" ? apartment.name : apartment.nameEn; const houseName = locale === "de" ? house.name : house.nameEn; const canBook = available && minStayValid; return (
{displayName}
{canBook ? ( ) : ( )} {canBook ? t("available") : !minStayValid ? t("minStayNotMet") : t("notAvailable")}

{displayName}

{houseName}
{apartment.maxGuests} {locale === "de" ? "Gäste" : "guests"}
{canBook && pricePerNight !== undefined && (

{formatPrice(pricePerNight, currency)}{" "} / {t("perNight")}

)} {canBook ? ( {t("bookThis")} ) : ( {locale === "de" ? "Details ansehen" : "View details"} )}
); }