import { redirect } from "next/navigation" import { getHotelData } from "@/lib/trpc/memoizedRequests" import Divider from "@/components/TempDesignSystem/Divider" import Body from "@/components/TempDesignSystem/Text/Body" import Caption from "@/components/TempDesignSystem/Text/Caption" import Title from "@/components/TempDesignSystem/Text/Title" import { getIntl } from "@/i18n" import styles from "./page.module.css" import type { LangParams, PageArgs } from "@/types/params" export default async function HotelHeader({ params, searchParams, }: PageArgs) { const home = `/${params.lang}` if (!searchParams.hotel) { redirect(home) } const hotelData = await getHotelData({ hotelId: searchParams.hotel, language: params.lang, }) if (!hotelData?.data) { redirect(home) } const intl = await getIntl() const hotel = hotelData.data.attributes return (
{hotel.name}
{hotel.address.streetAddress}, {hotel.address.city}
{intl.formatMessage( { id: "Distance in km to city centre" }, { number: hotel.location.distanceToCentre } )}
{hotel.hotelContent.texts.descriptions.short}
) }