54 lines
1.3 KiB
JavaScript
54 lines
1.3 KiB
JavaScript
/**
|
|
* Admin Navigation Builder (Server-Only)
|
|
*
|
|
* IMPORTANT: Navigation data must be serializable (no functions/components).
|
|
* Icons are passed as string names and resolved on the client.
|
|
*/
|
|
|
|
/**
|
|
* Build complete navigation sections
|
|
* @param {string} pathname - Current pathname
|
|
* @returns {Array} Navigation sections (serializable, icons as strings)
|
|
*/
|
|
export function buildNavigationSections(pathname) {
|
|
const coreNavigation = [
|
|
{
|
|
id: 'Dashboard',
|
|
title: 'Tableau de bord',
|
|
icon: 'DashboardSquare03Icon',
|
|
items: [
|
|
{
|
|
name: 'Tableau de bord',
|
|
href: '/admin/dashboard',
|
|
icon: 'DashboardSquare03Icon',
|
|
current: pathname === '/admin/dashboard'
|
|
},
|
|
]
|
|
}
|
|
];
|
|
|
|
const systemNavigation = [
|
|
{
|
|
id: 'users',
|
|
title: 'Utilisateurs',
|
|
icon: 'UserMultiple02Icon',
|
|
items: [
|
|
{
|
|
name: 'Utilisateurs',
|
|
href: '/admin/users',
|
|
icon: 'UserMultiple02Icon',
|
|
current: pathname.startsWith('/admin/users')
|
|
},
|
|
{
|
|
name: 'Rôles',
|
|
href: '/admin/roles',
|
|
icon: 'Crown03Icon',
|
|
current: pathname.startsWith('/admin/roles')
|
|
},
|
|
]
|
|
}
|
|
];
|
|
|
|
return [...coreNavigation, ...systemNavigation];
|
|
}
|