feat(layout): add admin panel layout with sidebar and header
- Add Sidebar component with navigation items (dashboard, bookings, tournaments, pos, clients, memberships, reports, settings) - Add Header component with SiteSwitcher and user info/logout - Add SiteSwitcher component for SUPER_ADMIN multi-site selection - Add admin layout wrapper with AuthProvider - Add placeholder Dashboard page Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
74
apps/web/components/layout/sidebar.tsx
Normal file
74
apps/web/components/layout/sidebar.tsx
Normal file
@@ -0,0 +1,74 @@
|
||||
'use client';
|
||||
|
||||
import Link from 'next/link';
|
||||
import { usePathname } from 'next/navigation';
|
||||
import {
|
||||
LayoutDashboard,
|
||||
Calendar,
|
||||
Trophy,
|
||||
ShoppingCart,
|
||||
Users,
|
||||
CreditCard,
|
||||
BarChart3,
|
||||
Settings,
|
||||
} from 'lucide-react';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
interface NavItem {
|
||||
label: string;
|
||||
href: string;
|
||||
icon: React.ComponentType<{ className?: string }>;
|
||||
}
|
||||
|
||||
const navItems: NavItem[] = [
|
||||
{ label: 'Dashboard', href: '/admin/dashboard', icon: LayoutDashboard },
|
||||
{ label: 'Reservas', href: '/admin/bookings', icon: Calendar },
|
||||
{ label: 'Torneos', href: '/admin/tournaments', icon: Trophy },
|
||||
{ label: 'Ventas', href: '/admin/pos', icon: ShoppingCart },
|
||||
{ label: 'Clientes', href: '/admin/clients', icon: Users },
|
||||
{ label: 'Membresías', href: '/admin/memberships', icon: CreditCard },
|
||||
{ label: 'Reportes', href: '/admin/reports', icon: BarChart3 },
|
||||
{ label: 'Configuración', href: '/admin/settings', icon: Settings },
|
||||
];
|
||||
|
||||
export function Sidebar() {
|
||||
const pathname = usePathname();
|
||||
|
||||
return (
|
||||
<aside className="fixed left-0 top-0 z-40 h-screen w-64 border-r border-primary-200 bg-white">
|
||||
{/* Logo Section */}
|
||||
<div className="flex h-16 items-center gap-3 border-b border-primary-200 px-6">
|
||||
<div className="flex h-10 w-10 items-center justify-center rounded-lg bg-primary text-white font-bold text-lg">
|
||||
P
|
||||
</div>
|
||||
<span className="text-xl font-semibold text-primary-800">Padel Pro</span>
|
||||
</div>
|
||||
|
||||
{/* Navigation */}
|
||||
<nav className="flex flex-col gap-1 p-4">
|
||||
{navItems.map((item) => {
|
||||
const isActive = pathname === item.href || pathname.startsWith(`${item.href}/`);
|
||||
const Icon = item.icon;
|
||||
|
||||
return (
|
||||
<Link
|
||||
key={item.href}
|
||||
href={item.href}
|
||||
className={cn(
|
||||
'flex items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium transition-colors',
|
||||
isActive
|
||||
? 'bg-primary text-white'
|
||||
: 'text-primary-600 hover:bg-primary-50 hover:text-primary-800'
|
||||
)}
|
||||
>
|
||||
<Icon className="h-5 w-5" />
|
||||
{item.label}
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
</nav>
|
||||
</aside>
|
||||
);
|
||||
}
|
||||
|
||||
export default Sidebar;
|
||||
Reference in New Issue
Block a user