"use client"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { Bot, FolderKanban, House, LifeBuoy, LogOut, Settings, type LucideIcon } from "lucide-react"; import { Brand } from "@/components/Brand"; import { ThemeToggle } from "@/components/ThemeToggle"; import { Button } from "@/components/ui/button"; import { cn } from "@/lib/utils"; interface Item { href: string; label: string; icon: LucideIcon; match: (p: string) => boolean; count?: "questions" | "waitingRunners"; } const ITEMS: Item[] = [ { href: "/", label: "Главная", icon: House, match: (p) => p === "/", count: "questions" }, { href: "/projects", label: "Проекты", icon: FolderKanban, match: (p) => p.startsWith("/projects") || p.startsWith("/p/") || p.startsWith("/t/") }, { href: "/runners", label: "Раннеры", icon: Bot, match: (p) => p.startsWith("/runners"), count: "waitingRunners" }, { href: "/help", label: "Помощь", icon: LifeBuoy, match: (p) => p.startsWith("/help") }, { href: "/settings", label: "Настройки", icon: Settings, match: (p) => p.startsWith("/settings") }, ]; const COUNT_TITLE = { questions: "вопросов ждут тебя", waitingRunners: "раннеров ждут тебя" }; /** Left panel on desktop; on phones a top bar plus a bottom tab bar (PEP-38): sections with «ждут тебя» counters, theme, user. */ export function Sidebar({ login, avatarUrl, counts }: { login: string; avatarUrl: string | null; counts: Record<"questions" | "waitingRunners", number> }) { const path = usePathname(); return (
фабрика
{avatarUrl && } {login}
); }