Files
web/components/MyPages/Blocks/Overview/UpcomingStays/index.tsx
Michael Zetterberg 14e93eba7c chore: lint fix
2024-04-23 14:43:17 +02:00

40 lines
1.0 KiB
TypeScript

import { serverClient } from "@/lib/trpc/server"
import Title from "@/components/MyPages/Title"
import Link from "@/components/TempDesignSystem/Link"
import EmptyUpcomingStaysBlock from "../../Stays/EmptyUpcomingStays"
import StayCard from "../../Stays/StayCard"
import styles from "./upcoming.module.css"
import type { LangParams } from "@/types/params"
export default async function UpcomingStays({ lang }: LangParams) {
const stays = await serverClient().user.stays.upcoming({
perPage: 3,
})
return (
<section className={styles.container}>
<header className={styles.header}>
<Title level="h2" as="h5" uppercase>
Your upcoming stays
</Title>
<Link className={styles.link} href="#">
See all
</Link>
</header>
{stays.length ? (
<section className={styles.stays}>
{stays.map((stay) => (
<StayCard key={stay.uid} stay={stay} lang={lang} />
))}
</section>
) : (
<EmptyUpcomingStaysBlock />
)}
</section>
)
}