feat: add SoonestStays

This commit is contained in:
Arvid Norlin
2024-04-22 13:34:57 +02:00
parent fc28e09df5
commit dff21b33cd
21 changed files with 235 additions and 107 deletions

View File

@@ -0,0 +1,35 @@
import { Lang } from "@/constants/languages"
import { serverClient } from "@/lib/trpc/server"
import Header from "../Header"
import StayList from "../StayList"
import EmptyUpcomingStaysBlock from "./EmptyUpcomingStays"
import styles from "./soonest.module.css"
type UpcomingStaysProps = {
lang: Lang
title: string
subtitle?: string
link: { text: string; href: string } | null
}
export default async function UpcomingStays({
lang,
title,
subtitle,
link,
}: UpcomingStaysProps) {
const stays = await serverClient().user.stays.soonestUpcoming()
return (
<section className={styles.container}>
<Header title={title} subtitle={subtitle} link={link}></Header>
{stays.length ? (
<StayList lang={lang} stays={stays} />
) : (
<EmptyUpcomingStaysBlock />
)}
</section>
)
}