feat(SW-1012): Added possibility for multiple include params for hotels

This commit is contained in:
Erik Tiekstra
2024-11-26 11:07:47 +01:00
committed by Fredrik Thorsson
parent 92bbfcf533
commit 05006506f0
17 changed files with 218 additions and 57 deletions

View File

@@ -0,0 +1 @@
export default function RestaurantSidepeek() {}

View File

@@ -0,0 +1,32 @@
import { restaurantAndBar } from "@/constants/routes/hotelPageParams"
import SidePeek from "@/components/TempDesignSystem/SidePeek"
import { getIntl } from "@/i18n"
import { getLang } from "@/i18n/serverContext"
import styles from "./restaurantBar.module.css"
import type { RestaurantBarSidePeekProps } from "@/types/components/hotelPage/sidepeek/restaurantBar"
export default async function RestaurantBarSidePeek({
restaurants,
}: RestaurantBarSidePeekProps) {
const lang = getLang()
const intl = await getIntl()
return (
<SidePeek
contentKey={restaurantAndBar[lang]}
title={intl.formatMessage({ id: "Restaurant & Bar" })}
>
<div className={styles.content}>
{restaurants.map((restaurant) => (
<div key={restaurant.id}>
<h3>{restaurant.name}</h3>
</div>
))}
</div>
</SidePeek>
)
}

View File

@@ -1,7 +1,6 @@
import { notFound } from "next/navigation"
import { Suspense } from "react"
import { restaurantAndBar } from "@/constants/routes/hotelPageParams"
import { env } from "@/env/server"
import { getHotelData, getHotelPage } from "@/lib/trpc/memoizedRequests"
@@ -21,6 +20,7 @@ import MapCard from "./Map/MapCard"
import MapWithCardWrapper from "./Map/MapWithCard"
import MobileMapToggle from "./Map/MobileMapToggle"
import StaticMap from "./Map/StaticMap"
import RestaurantBarSidePeek from "./SidePeeks/RestaurantBar"
import AmenitiesList from "./AmenitiesList"
import Facilities from "./Facilities"
import IntroSection from "./IntroSection"
@@ -78,8 +78,8 @@ export default async function HotelPage({ hotelId }: HotelPageProps) {
ratings,
parking,
} = hotelData.data.attributes
const roomCategories =
hotelData.included?.filter((item) => item.type === "roomcategories") || []
const roomCategories = hotelData.included?.rooms || []
const restaurants = hotelData.included?.restaurants || []
const images = gallery?.smallerImages
const description = hotelContent.texts.descriptions.medium
const activitiesCard = content?.[0]?.upcoming_activities_card || null
@@ -197,14 +197,8 @@ export default async function HotelPage({ hotelId }: HotelPageProps) {
ecoLabels={hotelFacts.ecoLabels}
descriptions={hotelContent.texts}
/>
<SidePeek
contentKey={restaurantAndBar[lang]}
title={intl.formatMessage({ id: "Restaurant & Bar" })}
>
{/* TODO */}
Restaurant & Bar
</SidePeek>
<WellnessAndExerciseSidePeek healthFacilities={healthFacilities} />
<RestaurantBarSidePeek restaurants={restaurants} />
{activitiesCard && (
<ActivitiesSidePeek contentPage={activitiesCard.contentPage} />
)}