Files
web/apps/scandic-web/components/Blocks/DynamicContent/SAS/TransferPoints/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

42 lines
955 B
TypeScript

import { Suspense } from "react"
import { env } from "@/env/server"
import { Section } from "@/components/Section"
import SectionHeader from "@/components/Section/Header/Deprecated"
import SectionLink from "@/components/Section/Link"
import { getLang } from "@/i18n/serverContext"
import {
TransferPointsForm,
TransferPointsFormSkeleton,
} from "./TransferPointsForm"
type Props = {
title?: string
link?: { href: string; text: string }
subtitle?: string
}
export default async function SASTransferPoints({
title,
subtitle,
link,
}: Props) {
if (!env.SAS_POINT_TRANSFER_ENABLED) {
return null
}
const lang = await getLang()
return (
<Section>
<SectionHeader link={link} preamble={subtitle} title={title} />
<SectionLink link={link} variant="mobile" />
<Suspense fallback={<TransferPointsFormSkeleton lang={lang} />}>
<TransferPointsForm lang={lang} />
</Suspense>
</Section>
)
}