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