This commit is contained in:
丹尼尔
2026-03-12 19:35:06 +08:00
commit ad96272ab6
40 changed files with 2645 additions and 0 deletions

View File

@@ -0,0 +1,81 @@
"use client";
import Link from "next/link";
import { usePathname } from "next/navigation";
import {
FileText,
FolderArchive,
Settings,
Building2,
Globe,
PiggyBank,
} from "lucide-react";
import { cn } from "@/lib/utils";
import { Separator } from "@/components/ui/separator";
import { Button } from "@/components/ui/button";
import { HistoricalReferences } from "@/components/historical-references";
const QUICK_LINKS = [
{ label: "国家税务总局门户", href: "https://www.chinatax.gov.cn", icon: Building2 },
{ label: "电子税务局", href: "https://etax.chinatax.gov.cn", icon: Globe },
{ label: "公积金管理中心", href: "https://www.12329.com.cn", icon: PiggyBank },
];
export function AppSidebar() {
const pathname = usePathname();
const nav = [
{ href: "/workspace", label: "需求与方案", icon: FileText },
{ href: "/finance", label: "财务归档", icon: FolderArchive },
{ href: "/settings", label: "设置", icon: Settings },
];
return (
<aside className="flex w-56 flex-col border-r bg-card text-card-foreground">
<div className="p-4">
<Link href="/" className="font-semibold text-foreground">
Ops-Core
</Link>
<p className="text-xs text-muted-foreground mt-0.5"></p>
</div>
<Separator />
<nav className="flex flex-1 flex-col gap-1 p-2">
{nav.map((item) => (
<Link key={item.href} href={item.href}>
<Button
variant={pathname === item.href ? "secondary" : "ghost"}
size="sm"
className="w-full justify-start"
>
<item.icon className="mr-2 h-4 w-4" />
{item.label}
</Button>
</Link>
))}
</nav>
<Separator />
<div className="p-2">
<p className="text-xs font-medium text-muted-foreground px-2 mb-2">
</p>
<div className="flex flex-col gap-1">
{QUICK_LINKS.map((link) => (
<a
key={link.href}
href={link.href}
target="_blank"
rel="noopener noreferrer"
className={cn(
"flex items-center gap-2 rounded-md px-2 py-1.5 text-sm text-muted-foreground hover:bg-accent hover:text-accent-foreground"
)}
>
<link.icon className="h-4 w-4 shrink-0" />
{link.label}
</a>
))}
</div>
</div>
{pathname === "/workspace" && <HistoricalReferences />}
</aside>
);
}