the-tip-top-frontend/components/admin/Sidebar.tsx
soufiane 646b3ecc02 refactor: extract SharedSidebar component to reduce code duplication
- Create SharedSidebar component in components/shared/
- Refactor admin Sidebar to use SharedSidebar
- Refactor employe layout to use SharedSidebar
- Reduces duplicated lines from 59.4% to ~0%

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 17:18:23 +01:00

71 lines
1.8 KiB
TypeScript

"use client";
import {
LayoutDashboard,
Users,
Ticket,
BarChart3,
Gift,
Trophy,
} from "lucide-react";
import { SharedSidebar, NavItem } from "@/components/shared/SharedSidebar";
const ADMIN_NAV_ITEMS: NavItem[] = [
{
label: "Dashboard",
href: "/admin/dashboard",
icon: <LayoutDashboard className="w-5 h-5" />,
color: "darkblue",
},
{
label: "Utilisateurs",
href: "/admin/utilisateurs",
icon: <Users className="w-5 h-5" />,
color: "blue",
},
{
label: "Tickets",
href: "/admin/tickets",
icon: <Ticket className="w-5 h-5" />,
color: "emerald",
},
{
label: "Lots & Prix",
href: "/admin/lots",
icon: <Gift className="w-5 h-5" />,
color: "purple",
},
{
label: "Données Marketing",
href: "/admin/marketing-data",
icon: <BarChart3 className="w-5 h-5" />,
color: "indigo",
},
{
label: "Tirages",
href: "/admin/tirages",
icon: <Trophy className="w-5 h-5" />,
color: "amber",
},
];
const ADMIN_ACTIVE_STYLES: Record<string, string> = {
darkblue: "bg-gradient-to-r from-[#1e3a5f] to-[#2d5a8f] text-white shadow-lg shadow-blue-900/30",
blue: "bg-gradient-to-r from-blue-600 to-indigo-600 text-white shadow-lg shadow-blue-500/30",
emerald: "bg-gradient-to-r from-emerald-600 to-teal-600 text-white shadow-lg shadow-emerald-500/30",
purple: "bg-gradient-to-r from-purple-600 to-pink-600 text-white shadow-lg shadow-purple-500/30",
indigo: "bg-gradient-to-r from-indigo-600 to-purple-600 text-white shadow-lg shadow-indigo-500/30",
amber: "bg-gradient-to-r from-amber-500 to-orange-600 text-white shadow-lg shadow-amber-500/30",
};
export default function Sidebar() {
return (
<SharedSidebar
navItems={ADMIN_NAV_ITEMS}
title="Thé Tip Top"
subtitle="Administration"
activeStyles={ADMIN_ACTIVE_STYLES}
/>
);
}