link-stack/apps/link/app/(main)/overview/[overview]/page.tsx

37 lines
768 B
TypeScript
Raw Normal View History

2023-06-26 10:07:12 +00:00
import { Metadata } from "next";
import { ZammadOverview } from "./_components/ZammadOverview";
2023-07-17 12:23:12 +00:00
const getSection = (overview: string) => {
return overview.charAt(0).toUpperCase() + overview.slice(1);
};
2023-06-26 10:07:12 +00:00
type MetadataProps = {
2024-11-25 09:31:25 +01:00
params: Promise<{
2023-06-26 10:07:12 +00:00
overview: string;
2024-11-25 09:31:25 +01:00
}>;
2023-06-26 10:07:12 +00:00
};
export async function generateMetadata({
2024-11-25 09:31:25 +01:00
params,
2023-06-26 10:07:12 +00:00
}: MetadataProps): Promise<Metadata> {
2024-11-25 09:31:25 +01:00
const { overview } = await params;
2023-07-17 12:23:12 +00:00
const section = getSection(overview);
2023-06-26 10:07:12 +00:00
return {
title: `CDR Link - ${section} Tickets`,
2023-06-26 10:07:12 +00:00
};
}
type PageProps = {
2024-11-25 09:31:25 +01:00
params: Promise<{
2023-06-26 10:07:12 +00:00
overview: string;
2024-11-25 09:31:25 +01:00
}>;
2023-06-26 10:07:12 +00:00
};
2024-11-25 09:31:25 +01:00
export default async function Page({ params }: PageProps) {
const { overview } = await params;
2023-07-17 12:23:12 +00:00
const section = getSection(overview);
return <ZammadOverview name={section} />;
2023-06-26 10:07:12 +00:00
}