Co-authored-by: CarinaWolli <[email protected]> Co-authored-by: Peer Richelsen <[email protected]> Co-authored-by: Carina Wollendorfer <[email protected]> Co-authored-by: Pradumn Kumar <[email protected]> Co-authored-by: zomars <[email protected]>
38 lines
1.0 KiB
TypeScript
38 lines
1.0 KiB
TypeScript
import TeamPage, { type PageProps } from "@pages/team/[slug]";
|
|
import { withAppDirSsr } from "app/WithAppDirSsr";
|
|
import type { Params, SearchParams } from "app/_types";
|
|
import { _generateMetadata } from "app/_utils";
|
|
import { WithLayout } from "app/layoutHOC";
|
|
import { type GetServerSidePropsContext } from "next";
|
|
import { cookies, headers } from "next/headers";
|
|
|
|
import { buildLegacyCtx } from "@lib/buildLegacyCtx";
|
|
import { getServerSideProps } from "@lib/team/[slug]/getServerSideProps";
|
|
|
|
export const generateMetadata = async ({
|
|
params,
|
|
searchParams,
|
|
}: {
|
|
params: Params;
|
|
searchParams: SearchParams;
|
|
}) => {
|
|
const props = await getData(
|
|
buildLegacyCtx(headers(), cookies(), params, searchParams) as unknown as GetServerSidePropsContext
|
|
);
|
|
const teamName = props.team.name || "Nameless Team";
|
|
|
|
return await _generateMetadata(
|
|
() => teamName,
|
|
() => teamName
|
|
);
|
|
};
|
|
|
|
const getData = withAppDirSsr<PageProps>(getServerSideProps);
|
|
|
|
export default WithLayout({
|
|
Page: TeamPage,
|
|
getData,
|
|
getLayout: null,
|
|
isBookingPage: true,
|
|
})<"P">;
|