fix: destructure attributes

This commit is contained in:
Chuma McPhoy
2024-07-08 12:47:55 +02:00
parent aff27f64a7
commit 753a379694

View File

@@ -15,27 +15,24 @@ export default async function HotelPage({ lang }: LangParams) {
return null
}
const hotelPageData = await serverClient().hotel.getHotel({
const {
data: { attributes },
} = await serverClient().hotel.getHotel({
hotelId: hotelPageIdentifierData.hotel_page_id,
language: lang,
})
const hotelAttributes = hotelPageData.data.attributes
return (
<main className={styles.pageContainer}>
<div className={styles.introContainer}>
<IntroSection
hotelName={hotelAttributes.name}
hotelDescription={
hotelAttributes.hotelContent.texts.descriptions.short
}
location={hotelAttributes.location}
address={hotelAttributes.address}
tripAdvisor={hotelAttributes.ratings.tripAdvisor}
/>
<AmenitiesList
detailedFacilities={hotelAttributes.detailedFacilities}
hotelName={attributes.name}
hotelDescription={attributes.hotelContent.texts.descriptions.short}
location={attributes.location}
address={attributes.address}
tripAdvisor={attributes.ratings.tripAdvisor}
/>
<AmenitiesList detailedFacilities={attributes.detailedFacilities} />
</div>
</main>
)