Files
web/app/[lang]/(partner)/(sas)/(protected)/sas-x-scandic/link/page.tsx
Anton Gunnarsson 419d21b3d0 Merged in feat/remove-date-input-from-sas-link-flow (pull request #1328)
Remove date input from SAS link flow

Approved-by: Linus Flood
2025-02-13 13:30:46 +00:00

30 lines
790 B
TypeScript

import { redirect } from "next/navigation"
import React from "react"
import { getProfileSafely } from "@/lib/trpc/memoizedRequests"
import { AlreadyLinkedError } from "../components/AlreadyLinkedError"
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>
)
}