Seth0330 commited on
Commit
31f2b47
·
verified ·
1 Parent(s): 00e8c2a

Update frontend/src/utils.js

Browse files
Files changed (1) hide show
  1. frontend/src/utils.js +6 -3
frontend/src/utils.js CHANGED
@@ -1,5 +1,8 @@
 
 
1
  export function createPageUrl(pageName) {
2
- if (pageName === "Dashboard") return "/dashboard";
3
- if (pageName === "History") return "/history";
4
- return "/dashboard";
 
5
  }
 
1
+ // frontend/src/utils.jsx
2
+
3
  export function createPageUrl(pageName) {
4
+ if (!pageName) return "/";
5
+ const lower = pageName.toLowerCase();
6
+ if (lower === "dashboard") return "/";
7
+ return `/${lower}`;
8
  }