mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-06 13:35:03 +00:00
user management ui
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { t } from "i18next";
|
||||
|
||||
export type ModuleKey = "objective" | "performance";
|
||||
|
||||
export const ROUTE_CONFIG: Record<
|
||||
ModuleKey,
|
||||
{
|
||||
basePath: string;
|
||||
planYearsPath: string;
|
||||
navLabelKey: string;
|
||||
}
|
||||
> = {
|
||||
performance: {
|
||||
basePath: "/performance-management",
|
||||
planYearsPath: "/performance-management/plan-years",
|
||||
navLabelKey: "nav.performanceManagement",
|
||||
},
|
||||
objective: {
|
||||
basePath: "/objective-management",
|
||||
planYearsPath: "/objective-management/plan-years",
|
||||
navLabelKey: "nav.objectiveManagement",
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,12 @@
|
||||
import { useLocation } from "react-router-dom";
|
||||
import { ModuleKey } from "./routeConfig";
|
||||
|
||||
export function useActiveModule(): ModuleKey {
|
||||
const { pathname } = useLocation();
|
||||
|
||||
if (pathname.startsWith("/objective-management")) {
|
||||
return "objective";
|
||||
}
|
||||
|
||||
return "performance";
|
||||
}
|
||||
Reference in New Issue
Block a user