SW-3490 set metadata for routes * feat(SW-3490): Set metadata title for hotelreservation paths Approved-by: Anton Gunnarsson
38 lines
768 B
TypeScript
38 lines
768 B
TypeScript
import "@scandic-hotels/common/polyfills"
|
|
|
|
import { configureTrpc } from "@/lib/trpc"
|
|
|
|
import { getTitlePrefix } from "@/util/metadata/getTitlePrfiex"
|
|
|
|
import type { Metadata } from "next"
|
|
|
|
configureTrpc()
|
|
|
|
export async function generateMetadata(): Promise<Metadata> {
|
|
return {
|
|
title: {
|
|
template: combineSegments([
|
|
getTitlePrefix(),
|
|
"%s",
|
|
"SAS by Scandic Hotels",
|
|
]),
|
|
default: combineSegments([getTitlePrefix(), "SAS by Scandic Hotels"]),
|
|
},
|
|
}
|
|
}
|
|
|
|
export default function RootLayout({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode
|
|
}) {
|
|
return <>{children}</>
|
|
}
|
|
|
|
function combineSegments(
|
|
segments: (string | null | undefined)[],
|
|
delimiter = " | "
|
|
) {
|
|
return segments.filter(Boolean).join(delimiter).trim()
|
|
}
|