// pages/room-detail.jsx — single room detail with gallery, amenities, policy function RoomDetailPage() { const { t, lang, navigate, currency, route } = useApp(); const idx = (route.params && route.params.roomIdx) || 0; const card = t.rooms.cards[idx] || t.rooms.cards[0]; const photos = photosFor(idx); const [activeImg, setActiveImg] = useState(0); const safeActive = Math.min(activeImg, Math.max(0, photos.length - 1)); return (
{card.tag} · 0{idx + 1} / 0{t.rooms.cards.length}

{card.name}

{card.desc}

{t.common.from}
{formatPrice(card.priceFrom, currency)}
{t.common.perNight} · {lang === "pl" ? "bez śniadania" : "no breakfast"}
{photos.length > 0 && ( <>
{photos.map((src, i) => ( ))}
)}
{t.roomDetail.amenitiesTitle}
    {t.roomDetail.amenities.map((a, i) => (
  • {a}
  • ))}
{t.roomDetail.includesTitle}
    {t.roomDetail.includes.map((a, i) => (
  • 0{i + 1} {a}
  • ))}
{t.roomDetail.policyTitle}
{t.roomDetail.policy.map(([k, v], i) => (
{k} {v}
))}

{lang === "pl" ? "Wszystkie nasze stawki są transparentne — bez ukrytych dopłat. Podatek VAT i opłata klimatyczna w cenie." : "All our rates are transparent — no hidden fees. VAT and local tax are included."}

{lang === "pl" ? "Szczegóły" : "Details"}

{lang === "pl" ? <>Pokój własny,
kuchnia wspólna. : <>Your own room,
a shared kitchen.}

{lang === "pl" ? "Każdy gość ma własny pokój z prywatną łazienką, pełen spokój na noc. Do tego dostęp 24h do wspólnej kuchni z pełnym wyposażeniem." : "Every guest has their own room with a private bathroom — full quiet at night. Plus 24-hour access to a fully equipped shared kitchen."}

{lang === "pl" ? "Płyta indukcyjna, mikrofalówka, lodówka, ekspres do kawy, toster, czajnik elektryczny i podstawowe naczynia. Możliwość prasowania na prośbę." : "Induction hob, microwave, fridge, espresso machine, toaster, electric kettle, and basic crockery. Iron and ironing board available on request."}

{lang === "pl" ? "Drugi pokój" : "The other room"}

{lang === "pl" ? "Może spodoba się też..." : "You may also like..."}

{(() => { const otherIdx = (idx + 1) % t.rooms.cards.length; const other = t.rooms.cards[otherIdx]; return ( navigate("room-detail", { roomIdx: otherIdx })} onBook={() => navigate("reservation", { roomIdx: otherIdx })} /> ); })()}
); } Object.assign(window, { RoomDetailPage });