Files
KART-FRONT-NEXT/src/lib/report-navigation.ts

21 lines
564 B
TypeScript

import type { Route } from "next";
export function isProjectPage(path: string): boolean {
return [
"/Report/Current",
"/Report/Quota",
"/Report/Tabulation",
"/Report/Crosstab",
"/Management/Derived",
"/Management/Exim",
].includes(path);
}
/**
* ProjectEntry verifies and consumes incoming project parameters. Subsequent navigation
* uses the tab's selected project; other paths open the progress page.
*/
export function projectPagePath(path: string): Route {
return (isProjectPage(path) ? path : "/Report/Current") as Route;
}