Files
web/app/[lang]/(partner)/(sas)/(protected)/sas-x-scandic/link/page.tsx
2025-02-17 10:43:54 +01:00

29 lines
720 B
TypeScript

import { redirect } from "next/navigation"
import React from "react"
import { getProfileSafely } from "@/lib/trpc/memoizedRequests"
import { SASModal } from "../components/SASModal"
import { LinkAccountForm } from "./LinkAccountForm"
import type { LangParams, PageArgs } from "@/types/params"
export default async function SASxScandicLinkPage({
params,
}: PageArgs<LangParams>) {
const profile = await getProfileSafely()
// TODO check if already linked
const alreadyLinked = false
if (alreadyLinked) {
redirect(`/${params.lang}/sas-x-scandic/error?errorCode=alreadyLinked`)
}
return (
<SASModal>
<LinkAccountForm userDateOfBirth={profile?.dateOfBirth ?? null} />
</SASModal>
)
}