import { getTranslations, setRequestLocale } from 'next-intl/server' import { mockDb } from '@/lib/mockDb' import ListingCard from '@/components/ListingCard' import { Link } from '@/i18n/routing' import { Search, MapPin, CheckCircle, ArrowRight } from 'lucide-react' export default async function HomePage({ params }: { params: Promise<{ locale: string }> }) { const { locale } = await params setRequestLocale(locale) const t = await getTranslations('hero') const homeT = await getTranslations('home') const navT = await getTranslations('nav') // Get active listings and filter for featured (Local Approved) const allListings = await mockDb.getListings() const featuredListings = allListings.filter(l => l.isLocalApproved).slice(0, 3) const categories = await mockDb.getCategories() const neighborhoods = await mockDb.getNeighborhoods() // Get localized names const getLocalizedName = (obj: any) => { if (!obj) return '' return locale === 'ru' ? obj.nameRu : locale === 'en' ? obj.nameEn : obj.nameTr } // Map category slug to lucide icons or nice visual cues const categoryImages: Record = { restoran: 'https://images.unsplash.com/photo-1555396273-367ea4eb4db5?w=800&auto=format&fit=crop&q=80', apart: 'https://images.unsplash.com/photo-1566073771259-6a8506099945?w=800&auto=format&fit=crop&q=80', isletme: 'https://images.unsplash.com/photo-1544551763-46a013bb70d5?w=800&auto=format&fit=crop&q=80' } const categoryPaths: Record = { restoran: '/restoranlar', apart: '/apartlar', isletme: '/isletmeler' } return (
{/* Hero Section */}
{/* Decorative background shapes */}
{/* Logo stamp effect */}
ML

{locale === 'tr' && ( <>En iyi yerel adresler,
turistin göremediği yerde. )} {locale === 'en' && ( <>The best local spots,
hidden from plain sight. )} {locale === 'ru' && ( <>Лучшие места,
которые знают местные. )}

{t('subtitle')}

{/* Search Form */}
{/* Local Approved Banner */}
{t('approvedBadge')} mührü ile güvenli rehber
{/* Category Grid Section */}

{homeT('categories')}

{homeT('categoriesSubtitle')}

{categories.map((cat) => { const imageUrl = categoryImages[cat.slug] || categoryImages.isletme const path = categoryPaths[cat.slug] || '/isletmeler' const catName = getLocalizedName(cat) return (
{catName}

{catName}

{homeT('explore')}
) })}
{/* Local Approved Featured Section */}
{t('approvedBadge')}

{homeT('featured')}

{homeT('featuredSubtitle')}

{locale === 'tr' ? 'tüm onaylı mekanlar' : locale === 'en' ? 'all approved places' : 'все проверенные места'}
{featuredListings.map((listing) => ( ))}
{/* Neighborhoods Section */}

{homeT('neighborhoods')}

{homeT('neighborhoodsSubtitle')}

{neighborhoods.map((neigh) => { const name = getLocalizedName(neigh) return ( {name} ) })}
{/* Trust Badge Explainer */}
YEREL
ONAYLI

yerel onay mührü nedir?

{t('approvedExplain')}

) }