feat: enhance stays with api data
This commit is contained in:
@@ -5,15 +5,15 @@ import Title from "@/components/Title"
|
||||
|
||||
import styles from "./stay.module.css"
|
||||
|
||||
import type { StayCardProps } from "@/types/components/myPages/myStays/stayCard"
|
||||
import type { StayCardProps } from "@/types/components/myPages/stays/stayCard"
|
||||
|
||||
export default function StayCard({ stay, lang }: StayCardProps) {
|
||||
const { dateArrive, dateDepart, guests, hotel } = stay
|
||||
const { checkinDate, checkoutDate, hotelInformation } = stay.attributes
|
||||
|
||||
const arrival = dt(dateArrive).locale(lang)
|
||||
const arrival = dt(checkinDate).locale(lang)
|
||||
const arrivalDate = arrival.format("DD MMM")
|
||||
const arrivalDateTime = arrival.format("YYYY-MM-DD")
|
||||
const depart = dt(dateDepart).locale(lang)
|
||||
const depart = dt(checkoutDate).locale(lang)
|
||||
const departDate = depart.format("DD MMM YYYY")
|
||||
const departDateTime = depart.format("YYYY-MM-DD")
|
||||
|
||||
@@ -27,7 +27,7 @@ export default function StayCard({ stay, lang }: StayCardProps) {
|
||||
uppercase
|
||||
className={styles.hotel}
|
||||
>
|
||||
{hotel}
|
||||
{hotelInformation.hotelName}
|
||||
</Title>
|
||||
<section className={styles.container}>
|
||||
<div className={styles.date}>
|
||||
@@ -43,17 +43,6 @@ export default function StayCard({ stay, lang }: StayCardProps) {
|
||||
<time dateTime={departDateTime}>{departDate}</time>
|
||||
</p>
|
||||
</div>
|
||||
<div className={styles.guests}>
|
||||
<Image
|
||||
alt="Guests Icon"
|
||||
height={20}
|
||||
src="/_static/icons/person.svg"
|
||||
width={20}
|
||||
/>
|
||||
<span>
|
||||
{guests} guest{guests > 1 ? "s" : ""}
|
||||
</span>
|
||||
</div>
|
||||
</section>
|
||||
</footer>
|
||||
</article>
|
||||
|
||||
Reference in New Issue
Block a user