{name}
{/* Stars and Price level */}{t('contact')}
{listing.address}
{(listing.openingHours as any).all || t('noHours')}
) : ({t('noHours')}
)}import { getTranslations, setRequestLocale } from 'next-intl/server' import { mockDb } from '@/lib/mockDb' import Navbar from '@/components/Navbar' import Footer from '@/components/Footer' import ListingCard from '@/components/ListingCard' import { notFound } from 'next/navigation' import Image from 'next/image' import { Phone, Globe, MapPin, Clock, Star, MessageSquare } from 'lucide-react' interface DetailPageProps { params: Promise<{ locale: string; category: string; slug: string }> } export default async function ListingDetailPage({ params }: DetailPageProps) { const { locale, category, slug } = await params setRequestLocale(locale) const t = await getTranslations('detail') const listing = await mockDb.getListingBySlug(slug) if (!listing) { notFound() } // Fetch similar listings in same category (limit to 3, excluding current) const allCategoryListings = await mockDb.getListings({ categoryId: listing.categoryId }) const relatedListings = allCategoryListings .filter(l => l.id !== listing.id) .slice(0, 3) // Localized values const name = locale === 'ru' ? listing.nameRu : locale === 'en' ? listing.nameEn : listing.nameTr const description = locale === 'ru' ? listing.descriptionRu : locale === 'en' ? listing.descriptionEn : listing.descriptionTr const priceSymbols = '₺'.repeat(listing.priceRange) // Format WhatsApp Link const getWhatsAppLink = (number: string) => { // Clean spaces, parenthesis, plus sign const cleanNum = number.replace(/\D/g, '') return `https://wa.me/${cleanNum}` } return (
{listing.address}
{(listing.openingHours as any).all || t('noHours')}
) : ({t('noHours')}
)}