feat(user): Add User Detail

This commit is contained in:
web@ppanel
2025-02-02 14:40:29 +07:00
parent 6733fc211c
commit fdaf11b654
66 changed files with 1977 additions and 704 deletions
+13 -1
View File
@@ -101,6 +101,12 @@ export const navs = [
title: 'User Management',
url: '/dashboard/user',
icon: 'flat-color-icons:conference-call',
items: [
{
title: 'User Detail',
url: '/dashboard/user/:id',
},
],
},
{
title: 'Announcement Management',
@@ -127,9 +133,15 @@ export const navs = [
];
export function findNavByUrl(url: string) {
function matchDynamicRoute(pattern: string, path: string): boolean {
const regexPattern = pattern.replace(/:[^/]+/g, '[^/]+').replace(/\//g, '\\/');
const regex = new RegExp(`^${regexPattern}$`);
return regex.test(path);
}
function findNav(items: any[], url: string, path: any[] = []): any[] {
for (const item of items) {
if (item.url === url) {
if (item.url === url || (item.url && matchDynamicRoute(item.url, url))) {
return [...path, item];
}
if (item.items) {