judge4c-latest/src/components/app-sidebar.tsx

146 lines
3.0 KiB
TypeScript
Raw Normal View History

2024-11-02 09:53:48 +00:00
"use client";
import {
BicepsFlexed,
2024-11-02 09:53:48 +00:00
BookOpen,
Bot,
GraduationCap,
2024-11-02 09:53:48 +00:00
LifeBuoy,
Map,
Send,
Settings2,
SquarePen,
2024-11-02 09:53:48 +00:00
} from "lucide-react";
import Link from "next/link";
import * as React from "react";
2024-11-02 09:53:48 +00:00
import { NavMain } from "@/components/nav-main";
import { NavUser } from "@/components/nav-user";
2024-11-02 09:53:48 +00:00
import { NavProjects } from "@/components/nav-projects";
import { NavSecondary } from "@/components/nav-secondary";
import {
Sidebar,
SidebarContent,
SidebarFooter,
SidebarHeader,
SidebarMenu,
SidebarMenuButton,
SidebarMenuItem,
} from "@/components/ui/sidebar";
const data = {
user: {
name: "ngc2207",
email: "cfngc3109@gmail.com",
avatar: "/litchi.svg",
2024-11-02 09:53:48 +00:00
},
navMain: [
{
title: "测验",
url: "/quiz",
icon: SquarePen,
2024-11-02 09:53:48 +00:00
isActive: true,
items: [
{
title: "提交记录",
2024-11-02 09:53:48 +00:00
url: "#",
},
],
},
{
title: "AI助教",
2024-11-02 09:53:48 +00:00
url: "#",
icon: Bot,
items: [
{
title: "设置",
2024-11-02 09:53:48 +00:00
url: "#",
},
],
},
{
title: "文档",
2024-11-02 09:53:48 +00:00
url: "#",
icon: BookOpen,
items: [
{
title: "简介",
2024-11-02 09:53:48 +00:00
url: "#",
},
{
title: "入门指南",
2024-11-02 09:53:48 +00:00
url: "#",
},
{
title: "教程",
2024-11-02 09:53:48 +00:00
url: "#",
},
{
title: "更新日志",
2024-11-02 09:53:48 +00:00
url: "#",
},
],
},
{
title: "应用设置",
2024-11-02 09:53:48 +00:00
url: "#",
icon: Settings2,
},
],
navSecondary: [
{
title: "支持",
2024-11-02 09:53:48 +00:00
url: "#",
icon: LifeBuoy,
},
{
title: "反馈",
2024-11-02 09:53:48 +00:00
url: "#",
icon: Send,
},
],
projects: [
{
name: "校园助手",
2024-11-02 09:53:48 +00:00
url: "#",
icon: Map,
2024-11-02 09:53:48 +00:00
},
{
name: "健身俱乐部",
2024-11-02 09:53:48 +00:00
url: "#",
icon: BicepsFlexed,
2024-11-02 09:53:48 +00:00
},
],
};
export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
return (
<Sidebar variant="inset" {...props}>
<SidebarHeader>
<SidebarMenu>
<SidebarMenuItem>
<SidebarMenuButton size="lg" asChild>
<Link href="/">
2024-11-02 09:53:48 +00:00
<div className="flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground">
<GraduationCap className="size-6" />
2024-11-02 09:53:48 +00:00
</div>
<div className="grid flex-1 text-left text-sm leading-tight">
<span className="truncate font-semibold"></span>
<span className="truncate text-xs"></span>
2024-11-02 09:53:48 +00:00
</div>
</Link>
2024-11-02 09:53:48 +00:00
</SidebarMenuButton>
</SidebarMenuItem>
</SidebarMenu>
</SidebarHeader>
<SidebarContent>
<NavMain items={data.navMain} />
<NavProjects projects={data.projects} />
<NavSecondary items={data.navSecondary} className="mt-auto" />
</SidebarContent>
<SidebarFooter>
<NavUser user={data.user} />
</SidebarFooter>
</Sidebar>
);
}