Files
web/apps/scandic-web/components/Blocks/DynamicContent/Stays/NextStay/index.tsx
Chuma Mcphoy (We Ahead) f40035baa9 Merged in LOY-493/Sidepeek-upcoming-stays (pull request #3315)
LOY-493/Sidepeek upcoming stays

* chore(LOY-493): Add icon to next stay card cta

* chore(LOY-493): better folder org for stays

* chore(LOY-494): more folder reorg

* feat(LOY-493): Implement Sidepeek for Upcoming Stays


Approved-by: Matilda Landström
2025-12-09 10:54:57 +00:00

31 lines
948 B
TypeScript

import { env } from "@/env/server"
import { serverClient } from "@/lib/trpc/server"
import { Section } from "@/components/Section"
import { SectionHeader } from "@/components/Section/Header"
import SectionLink from "@/components/Section/Link"
import EmptyUpcomingStays from "../Upcoming/EmptyUpcomingStays"
import NextStayContent from "./NextStayContent"
import styles from "./nextStay.module.css"
import type { NextStayProps } from "./types"
export default async function NextStay({ title, link }: NextStayProps) {
const caller = await serverClient()
const nextStay = await caller.user.stays.next()
if (!nextStay) {
return env.NEW_STAYS_ON_MY_PAGES ? <EmptyUpcomingStays /> : null
}
return (
<Section className={styles.container}>
{title && <SectionHeader heading={title} link={link} />}
<NextStayContent nextStay={nextStay} />
{link && <SectionLink link={link} variant="mobile" />}
</Section>
)
}