import { getTranslations, setRequestLocale } from 'next-intl/server' import { Link } from '@/i18n/routing' import Image from 'next/image' import { notFound } from 'next/navigation' import { CheckCircle2, Maximize, Users, BedDouble, ArrowRight } from 'lucide-react' import { db } from '@/lib/db' import openinaryLoader from '@/lib/openinary-loader' // Bu sayfa parametre olarak dinamik slug alacak export default async function RoomDetailPage({ params }: { params: Promise<{ locale: string, slug: string }> }) { const { locale, slug } = await params setRequestLocale(locale) const tRooms = await getTranslations('rooms') const room = await db.room.findUnique({ where: { slug } }) if (!room || !room.available) { notFound(); } const name = locale === 'tr' ? room.nameTr : locale === 'de' ? room.nameDe : room.nameEn const description = locale === 'tr' ? room.descriptionTr : locale === 'de' ? room.descriptionDe : room.descriptionEn const image = room.imageUrl || 'https://images.unsplash.com/photo-1631049307264-da0ec9d70304?auto=format&fit=crop&q=80' const isExternalImage = image.startsWith('http') && !image.includes('media.ayris.tech') const gallery = room.images && room.images.length > 0 ? room.images : [image] // Size helper mapping based on room type const getRoomSize = (type: string) => { if (type === 'STUDIO_1_0') return '25m²' if (type === 'SUITE_1_1') return '45m²' return '20m²' } // Bed helper based on capacity/type roughly const getBeds = (type: string, capacity: number) => { if (type === 'STUDIO_1_0') return '1' if (type === 'SUITE_1_1') return '2' if (capacity === 3) return '1 + Ek Yatak' return '1' } return (
{/* Hero Section */}
{isExternalImage ? ( {name} ) : ( {name} )}

{name}

{/* Main Content */}
{/* Left Column - Details */}
{/* Badges */}
Maks {room.capacity} Kişi
{getRoomSize(room.type)}
{getBeds(room.type, room.capacity)}
{/* Description */}

{description}

{/* Amenities */} {room.amenities.length > 0 && (

{tRooms('details.features')}

{room.amenities.map((amenity, index) => (
{amenity}
))}
)} {/* Mini Gallery */} {gallery.length > 0 && (

{tRooms('details.gallery')}

{gallery.map((img, i) => { const isGalleryExternal = img.startsWith('http') && !img.includes('media.ayris.tech') return (
{isGalleryExternal ? ( {`${name} ) : ( {`${name} )}
) })}
)}
{/* Right Column - Sticky Sidebar */}

Bilgi Alın

Tarihlerinize uygun fiyat ve müsaitlik durumunu öğrenmek için bizimle iletişime geçin.

{tRooms('details.book_now_cta')}
) }