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 = {
|
|
|
|
|
params: {
|
|
|
|
|
overview: string;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export async function generateMetadata({
|
|
|
|
|
params: { overview },
|
|
|
|
|
}: MetadataProps): Promise<Metadata> {
|
2023-07-17 12:23:12 +00:00
|
|
|
const section = getSection(overview);
|
2023-06-26 10:07:12 +00:00
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
title: `Link - ${section} Tickets`,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const overviews = {
|
|
|
|
|
assigned: 1,
|
|
|
|
|
unassigned: 2,
|
2023-10-16 09:20:40 +02:00
|
|
|
recent: 3,
|
|
|
|
|
open: 5,
|
2023-06-26 10:07:12 +00:00
|
|
|
urgent: 7,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
type PageProps = {
|
|
|
|
|
params: {
|
|
|
|
|
overview: string;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default function Page({ params: { overview } }: PageProps) {
|
2023-07-17 12:23:12 +00:00
|
|
|
const section = getSection(overview);
|
2023-10-16 09:20:40 +02:00
|
|
|
console.log({ section });
|
2023-07-17 12:23:12 +00:00
|
|
|
|
|
|
|
|
return <ZammadOverview name={section} id={overviews[overview]} />;
|
2023-06-26 10:07:12 +00:00
|
|
|
}
|