Files
web/apps/scandic-web/components/Blocks/DynamicContent/Stays/Previous/index.tsx
Erik Tiekstra 339e7195dc fix(BOOK-436): Added new section component and deprecated the other
Approved-by: Chuma Mcphoy (We Ahead)
2025-10-13 08:31:26 +00:00

39 lines
1.0 KiB
TypeScript

import { serverClient } from "@/lib/trpc/server"
import ClaimPoints from "@/components/Blocks/DynamicContent/Points/ClaimPoints"
import { Section } from "@/components/Section"
import SectionHeader from "@/components/Section/Header/Deprecated"
import SectionLink from "@/components/Section/Link"
import ClientPreviousStays from "./Client"
import styles from "./previous.module.css"
import type { AccountPageComponentProps } from "@/types/components/myPages/myPage/accountPage"
export default async function PreviousStays({
title,
link,
}: AccountPageComponentProps) {
const caller = await serverClient()
const initialPreviousStays = await caller.user.stays.previous({
limit: 6,
})
if (!initialPreviousStays?.data.length) {
return null
}
return (
<Section>
<div className={styles.header}>
<SectionHeader title={title} link={link} />
<ClaimPoints />
</div>
<ClientPreviousStays initialPreviousStays={initialPreviousStays} />
<SectionLink link={link} variant="mobile" />
</Section>
)
}