Update AI coach calibration, fix streak animation speed, add dashboard features and target filtering
This commit is contained in:
@@ -1,14 +1,21 @@
|
||||
"use client"
|
||||
"use client"
|
||||
|
||||
import { ReactNode } from "react"
|
||||
import { LayoutDashboard, Users, Database, Terminal, Settings, FileText, Tag } from "lucide-react"
|
||||
import { LayoutDashboard, Users, Database, Terminal, Settings, FileText, Tag, LogOut } from "lucide-react"
|
||||
import Link from "next/link"
|
||||
import { usePathname } from "next/navigation"
|
||||
import { usePathname, useRouter } from "next/navigation"
|
||||
import { Logo } from "@/components/Logo"
|
||||
import { AdminThemeToggle } from "@/components/AdminThemeToggle"
|
||||
|
||||
export default function AdminLayout({ children }: { children: ReactNode }) {
|
||||
const pathname = usePathname()
|
||||
const router = useRouter()
|
||||
|
||||
const handleLogout = () => {
|
||||
localStorage.removeItem("auth_token");
|
||||
document.cookie = "auth_token=; path=/; max-age=0;";
|
||||
router.push("/login");
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="flex h-screen bg-background overflow-hidden text-foreground selection:bg-[var(--cyan-ai-20)]">
|
||||
@@ -26,8 +33,15 @@ export default function AdminLayout({ children }: { children: ReactNode }) {
|
||||
<NavItem href="/admin/students" icon={<Users size={18} />} label="Students" active={pathname.startsWith("/admin/students")} />
|
||||
<NavItem href="/admin/coupons" icon={<Tag size={18} />} label="Coupons" active={pathname.startsWith("/admin/coupons")} />
|
||||
</nav>
|
||||
<div className="p-4 border-t border-border">
|
||||
<div className="p-4 border-t border-border flex flex-col gap-2">
|
||||
<NavItem href="/admin/settings" icon={<Settings size={18} />} label="System Settings" active={pathname.startsWith("/admin/settings")} />
|
||||
<button
|
||||
onClick={handleLogout}
|
||||
className="flex items-center w-full text-left gap-3 px-3 py-2.5 rounded-xl transition-all duration-300 text-red-500 hover:bg-red-500/10 font-medium"
|
||||
>
|
||||
<LogOut size={18} />
|
||||
<span className="text-sm">Logout</span>
|
||||
</button>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user