Sidebar.tsx
2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
"use client";
import Link from "next/link";
import { usePathname } from "next/navigation";
import { BookOpen, Database, FileText } from "lucide-react";
import { cn } from "@/lib/utils";
export default function Sidebar() {
const pathname = usePathname();
return (
<aside className="w-16 flex flex-col items-center py-6 bg-slate-900 text-slate-400 shrink-0">
<div className="w-10 h-10 bg-blue-600 rounded-xl flex items-center justify-center text-white mb-8 shadow-lg shadow-blue-500/20">
<BookOpen className="w-6 h-6 fill-current" />
</div>
<nav className="flex-1 flex flex-col gap-6">
<Link
href="/"
className={cn(
"p-2 rounded-lg transition relative group",
pathname === "/" ? "bg-slate-800 text-white" : "hover:bg-slate-800 hover:text-slate-200"
)}
title="Wiki 原始文件"
>
<FileText className="w-5 h-5" />
<span className="absolute left-full ml-2 px-2 py-1 bg-slate-800 text-white text-xs rounded opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-50">
Wiki 原始文件
</span>
</Link>
<Link
href="/wiki-repo"
className={cn(
"p-2 rounded-lg transition relative group",
pathname === "/wiki-repo" ? "bg-slate-800 text-white" : "hover:bg-slate-800 hover:text-slate-200"
)}
title="Wiki 知识库"
>
<BookOpen className="w-5 h-5" />
<span className="absolute left-full ml-2 px-2 py-1 bg-slate-800 text-white text-xs rounded opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-50">
Wiki 知识库
</span>
</Link>
<Link
href="/rag"
className={cn(
"p-2 rounded-lg transition relative group",
pathname === "/rag" ? "bg-slate-800 text-white" : "hover:bg-slate-800 hover:text-slate-200"
)}
title="RAG 工作台"
>
<Database className="w-5 h-5" />
<span className="absolute left-full ml-2 px-2 py-1 bg-slate-800 text-white text-xs rounded opacity-0 group-hover:opacity-100 pointer-events-none whitespace-nowrap z-50">
RAG 工作台
</span>
</Link>
</nav>
</aside>
);
}