Files
tabatago/admin-web/components/sidebar.tsx
Millian Lamiaux 791f432334 refactor: code quality cleanup — remove any types, add logger, rename Kine to Tabata
- Phase 0: Rename all Kine references to Tabata (types, files, imports, i18n, analytics events)
- Phase 1: Add test coverage for tabataProgramStore, workoutProgramStore, and color utils (47 tests)
- Phase 2: Remove all `any` types from production code with proper typed replacements
- Phase 3: Replace ~60 raw console.* calls with __DEV__-gated logger utility
- Phase 4: Verify .DS_Store housekeeping (already clean)

0 TypeScript errors, 583/583 tests passing.
2026-04-17 18:56:24 +02:00

82 lines
2.4 KiB
TypeScript

"use client";
import Link from "next/link";
import { usePathname, useRouter } from "next/navigation";
import { supabase } from "@/lib/supabase";
import { Button } from "@/components/ui/button";
import {
LayoutDashboard,
Dumbbell,
Users,
FolderOpen,
ImageIcon,
Music,
LogOut,
Flame,
LayoutGrid,
} from "lucide-react";
const navItems = [
{ href: "/", label: "Dashboard", icon: LayoutDashboard },
{ href: "/workouts", label: "Workouts", icon: Dumbbell },
{ href: "/programs", label: "Programs", icon: LayoutGrid },
{ href: "/trainers", label: "Trainers", icon: Users },
{ href: "/collections", label: "Collections", icon: FolderOpen },
{ href: "/media", label: "Media", icon: ImageIcon },
{ href: "/music", label: "Music", icon: Music },
];
export function Sidebar() {
const pathname = usePathname();
const router = useRouter();
const handleLogout = async () => {
await supabase.auth.signOut();
router.push("/login");
};
return (
<aside className="w-64 bg-neutral-950 border-r border-neutral-800 flex flex-col h-screen sticky top-0">
<div className="p-6 border-b border-neutral-800">
<div className="flex items-center gap-2">
<Flame className="w-6 h-6 text-orange-500" />
<span className="text-lg font-bold text-white">TabataFit</span>
</div>
<p className="text-neutral-500 text-sm mt-1">Admin Dashboard</p>
</div>
<nav className="flex-1 p-4 space-y-1">
{navItems.map((item) => {
const Icon = item.icon;
const isActive = pathname === item.href;
return (
<Link
key={item.href}
href={item.href}
className={`flex items-center gap-3 px-4 py-3 rounded-lg text-sm font-medium transition-colors ${
isActive
? "bg-orange-500/10 text-orange-500"
: "text-neutral-400 hover:text-white hover:bg-neutral-900"
}`}
>
<Icon className="w-5 h-5" />
{item.label}
</Link>
);
})}
</nav>
<div className="p-4 border-t border-neutral-800">
<Button
variant="ghost"
className="w-full justify-start text-neutral-400 hover:text-white"
onClick={handleLogout}
>
<LogOut className="w-5 h-5 mr-3" />
Logout
</Button>
</div>
</aside>
);
}