refact & cleanup : Sidebar, Button, card, EmptyState, Loader, ServiceObject, StatusBadge, UptameObject, BackupWidget, SecurityWidget, ServicesWidget, SupportCtaWidget, UptimeWidget, DashboardLayout
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
import React from 'react';
|
||||
import { NavLink } from 'react-router-dom';
|
||||
import { cn } from '@/utils/utils';
|
||||
|
||||
interface SidebarProps {
|
||||
onLogout: () => void;
|
||||
}
|
||||
|
||||
const NAVIGATION_ITEMS = [
|
||||
{ name: 'Trust Center', path: '/dashboard' },
|
||||
{ name: 'Service Desk', path: '/support' },
|
||||
{ name: 'Coffre-fort', path: '/vault' },
|
||||
{ name: 'Paramètres', path: '/account' },
|
||||
];
|
||||
|
||||
export const Sidebar: React.FC<SidebarProps> = ({ onLogout }) => {
|
||||
return (
|
||||
<aside className="w-64 bg-slate-900 flex flex-col shrink-0">
|
||||
{/* En-tête / Logo */}
|
||||
<div className="h-16 flex items-center px-6 border-b border-slate-800">
|
||||
<span className="text-xl font-bold text-white tracking-widest">Aegis<span className="text-blue-500">.</span></span>
|
||||
</div>
|
||||
|
||||
{/* Menu de navigation URL-based */}
|
||||
<nav className="flex-1 px-4 py-6 space-y-2">
|
||||
{NAVIGATION_ITEMS.map((item) => (
|
||||
<NavLink
|
||||
key={item.path}
|
||||
to={item.path}
|
||||
className={({ isActive }) =>
|
||||
cn(
|
||||
"flex items-center px-4 py-3 text-sm font-medium rounded-lg transition-colors duration-200",
|
||||
isActive
|
||||
? "bg-blue-900/50 text-white border border-blue-800/50"
|
||||
: "text-slate-400 hover:bg-slate-800 hover:text-slate-200 border border-transparent"
|
||||
)
|
||||
}
|
||||
>
|
||||
{item.name}
|
||||
</NavLink>
|
||||
))}
|
||||
</nav>
|
||||
|
||||
{/* Zone de déconnexion */}
|
||||
<div className="p-4 border-t border-slate-800">
|
||||
<button
|
||||
onClick={onLogout}
|
||||
className="w-full flex items-center justify-center px-4 py-2 text-sm font-medium text-slate-400 hover:text-red-400 hover:bg-slate-800 rounded-lg transition-all cursor-pointer"
|
||||
>
|
||||
Déconnexion
|
||||
</button>
|
||||
</div>
|
||||
</aside>
|
||||
);
|
||||
};
|
||||
|
||||
export default Sidebar;
|
||||
Reference in New Issue
Block a user