chore: create a IntroSectionProps type
This commit is contained in:
@@ -19,21 +19,22 @@ export default async function HotelPage({ lang }: LangParams) {
|
||||
hotelId: hotelPageIdentifierData.hotel_page_id,
|
||||
language: lang,
|
||||
})
|
||||
const hotelAttributes = hotelPageData.data.attributes
|
||||
|
||||
return (
|
||||
<main className={styles.pageContainer}>
|
||||
<div className={styles.introContainer}>
|
||||
<IntroSection
|
||||
hotelName={hotelPageData.data.attributes.name}
|
||||
hotelName={hotelAttributes.name}
|
||||
hotelDescription={
|
||||
hotelPageData.data.attributes.hotelContent.texts.descriptions.short
|
||||
hotelAttributes.hotelContent.texts.descriptions.short
|
||||
}
|
||||
location={hotelPageData.data.attributes.location}
|
||||
address={hotelPageData.data.attributes.address}
|
||||
tripAdvisor={hotelPageData.data.attributes.ratings.tripAdvisor}
|
||||
location={hotelAttributes.location}
|
||||
address={hotelAttributes.address}
|
||||
tripAdvisor={hotelAttributes.ratings.tripAdvisor}
|
||||
/>
|
||||
<AmenitiesList
|
||||
detailedFacilities={hotelPageData.data.attributes.detailedFacilities}
|
||||
detailedFacilities={hotelAttributes.detailedFacilities}
|
||||
/>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
@@ -7,9 +7,9 @@ import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
|
||||
import Title from "@/components/TempDesignSystem/Text/Title"
|
||||
import { getIntl } from "@/i18n"
|
||||
|
||||
import styles from "./introSection.module.css"
|
||||
import { IntroSectionProps } from "./types"
|
||||
|
||||
import { HotelAddress, HotelData, HotelLocation } from "@/types/hotel"
|
||||
import styles from "./introSection.module.css"
|
||||
|
||||
export default async function IntroSection({
|
||||
hotelName,
|
||||
@@ -17,13 +17,7 @@ export default async function IntroSection({
|
||||
location,
|
||||
address,
|
||||
tripAdvisor,
|
||||
}: {
|
||||
hotelName: HotelData["data"]["attributes"]["name"]
|
||||
hotelDescription: HotelData["data"]["attributes"]["hotelContent"]["texts"]["descriptions"]["short"]
|
||||
location: HotelLocation
|
||||
address: HotelAddress
|
||||
tripAdvisor: HotelData["data"]["attributes"]["ratings"]["tripAdvisor"]
|
||||
}) {
|
||||
}: IntroSectionProps) {
|
||||
const intl = await getIntl()
|
||||
const { formatMessage } = intl
|
||||
const { streetAddress, city } = address
|
||||
|
||||
14
components/ContentType/HotelPage/IntroSection/types.ts
Normal file
14
components/ContentType/HotelPage/IntroSection/types.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import {
|
||||
HotelAddress,
|
||||
HotelData,
|
||||
HotelLocation,
|
||||
HotelTripAdvisor,
|
||||
} from "@/types/hotel"
|
||||
|
||||
export type IntroSectionProps = {
|
||||
hotelName: HotelData["data"]["attributes"]["name"]
|
||||
hotelDescription: HotelData["data"]["attributes"]["hotelContent"]["texts"]["descriptions"]["short"]
|
||||
location: HotelLocation
|
||||
address: HotelAddress
|
||||
tripAdvisor: HotelTripAdvisor
|
||||
}
|
||||
Reference in New Issue
Block a user