feat: use getHotel data

This commit is contained in:
Fredrik Thorsson
2024-07-09 16:36:37 +02:00
parent 54daa1735a
commit 286d772de1
6 changed files with 31 additions and 81 deletions

View File

@@ -4,12 +4,14 @@ import Button from "@/components/TempDesignSystem/Button"
import Chip from "@/components/TempDesignSystem/Chip"
import Body from "@/components/TempDesignSystem/Text/Body"
import Title from "@/components/TempDesignSystem/Text/Title"
import { HotelCardData } from "./data"
import { getIntl } from "@/i18n"
import styles from "./hotelCard.module.css"
export default function HotelCard({ hotel }: HotelCardData) {
import { HotelCardProps } from "@/types/components/hotelReservation/selectHotel/hotelCardProps"
export default async function HotelCard({ hotel }: HotelCardProps) {
const { formatMessage } = await getIntl()
return (
<article className={styles.card}>
<Image src="" alt="hotel image" className={styles.image} />
@@ -19,12 +21,12 @@ export default function HotelCard({ hotel }: HotelCardData) {
<Title as="h4">{hotel.name}</Title>
</header>
<div className={styles.description}>
<span>{hotel.address}</span>
<span>{hotel.description}</span>
<span>{`${hotel.address.streetAddress}, ${hotel.address.city}`}</span>
<span>{hotel.hotelContent.texts.descriptions.short}</span>
</div>
<div className={styles.chips}>
{hotel.label.map((chip, index) => (
<Chip key={`chip-${index}`}>{chip}</Chip>
{hotel.detailedFacilities.slice(0, 6).map((chip, index) => (
<Chip key={`chip-${index}`}>{chip.name}</Chip>
))}
</div>
<footer className={styles.booking}>
@@ -34,11 +36,8 @@ export default function HotelCard({ hotel }: HotelCardData) {
size="small"
className={styles.button}
>
{hotel.button}
{formatMessage({ id: "Book" })}
</Button>
<Body color="burgundy">
<span>{hotel.rooms}</span>
</Body>
</footer>
</div>
</article>