2025-06-17 09:05:15 +00:00
|
|
|
"use client"
|
|
|
|
import { siteConfig } from "@/config/site"
|
|
|
|
import * as React from "react"
|
2025-03-16 12:31:21 +00:00
|
|
|
import {
|
2025-06-17 09:05:15 +00:00
|
|
|
BookOpen,
|
2025-03-16 12:31:21 +00:00
|
|
|
Command,
|
2025-06-17 09:05:15 +00:00
|
|
|
LifeBuoy,
|
|
|
|
Send,
|
2025-03-16 12:31:21 +00:00
|
|
|
Settings2,
|
|
|
|
SquareTerminal,
|
2025-06-17 09:05:15 +00:00
|
|
|
} from "lucide-react"
|
|
|
|
|
|
|
|
import { NavMain } from "@/components/nav-main"
|
|
|
|
import { NavProjects } from "@/components/nav-projects"
|
|
|
|
import { NavSecondary } from "@/components/nav-secondary"
|
|
|
|
import { NavUser } from "@/components/nav-user"
|
2025-03-16 12:31:21 +00:00
|
|
|
import {
|
|
|
|
Sidebar,
|
|
|
|
SidebarContent,
|
|
|
|
SidebarFooter,
|
|
|
|
SidebarHeader,
|
2025-06-17 09:05:15 +00:00
|
|
|
SidebarMenu,
|
|
|
|
SidebarMenuButton,
|
|
|
|
SidebarMenuItem,
|
|
|
|
} from "@/components/ui/sidebar"
|
2025-03-16 12:31:21 +00:00
|
|
|
|
2025-06-19 08:07:40 +00:00
|
|
|
|
2025-03-16 12:31:21 +00:00
|
|
|
const data = {
|
2025-06-17 09:05:15 +00:00
|
|
|
user: {
|
|
|
|
name: "shadcn",
|
|
|
|
email: "m@example.com",
|
|
|
|
avatar: "/avatars/shadcn.jpg",
|
|
|
|
},
|
2025-03-16 12:31:21 +00:00
|
|
|
navMain: [
|
|
|
|
{
|
2025-06-18 09:49:07 +00:00
|
|
|
title: "页面",
|
2025-06-17 09:05:15 +00:00
|
|
|
url: "#",
|
2025-03-16 12:31:21 +00:00
|
|
|
icon: SquareTerminal,
|
|
|
|
isActive: true,
|
2025-06-17 09:05:15 +00:00
|
|
|
items: [
|
|
|
|
{
|
2025-06-18 09:49:07 +00:00
|
|
|
title: "主页",
|
2025-06-19 08:07:40 +00:00
|
|
|
url: "/student/dashboard",
|
2025-06-17 09:05:15 +00:00
|
|
|
},
|
|
|
|
{
|
2025-06-18 09:49:07 +00:00
|
|
|
title: "历史记录",
|
2025-06-17 09:05:15 +00:00
|
|
|
url: "#",
|
|
|
|
},
|
|
|
|
{
|
2025-06-18 09:49:07 +00:00
|
|
|
title: "题目集",
|
2025-06-17 09:05:15 +00:00
|
|
|
url: "/problemset",
|
|
|
|
},
|
|
|
|
],
|
2025-03-16 12:31:21 +00:00
|
|
|
},
|
2025-06-17 09:05:15 +00:00
|
|
|
|
2025-03-16 12:31:21 +00:00
|
|
|
{
|
2025-06-18 09:49:07 +00:00
|
|
|
title: "已完成事项",
|
2025-03-16 12:31:21 +00:00
|
|
|
url: "#",
|
2025-06-17 09:05:15 +00:00
|
|
|
icon: BookOpen,
|
2025-03-16 12:31:21 +00:00
|
|
|
items: [
|
|
|
|
{
|
2025-06-18 09:49:07 +00:00
|
|
|
title: "全部编程集",
|
2025-03-16 12:31:21 +00:00
|
|
|
url: "#",
|
|
|
|
},
|
|
|
|
{
|
2025-06-18 09:49:07 +00:00
|
|
|
title: "错题集",
|
2025-03-16 12:31:21 +00:00
|
|
|
url: "#",
|
|
|
|
},
|
2025-06-18 09:49:07 +00:00
|
|
|
{
|
|
|
|
title: "收藏集",
|
2025-03-16 12:31:21 +00:00
|
|
|
url: "#",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
2025-06-18 09:49:07 +00:00
|
|
|
title: "设置",
|
2025-06-17 09:05:15 +00:00
|
|
|
url: "#",
|
2025-03-16 12:31:21 +00:00
|
|
|
icon: Settings2,
|
|
|
|
items: [
|
|
|
|
{
|
2025-06-18 09:49:07 +00:00
|
|
|
title: "一般设置",
|
2025-06-17 09:05:15 +00:00
|
|
|
url: "#",
|
2025-03-16 12:31:21 +00:00
|
|
|
},
|
|
|
|
{
|
2025-06-18 09:49:07 +00:00
|
|
|
title: "语言",
|
2025-06-17 09:05:15 +00:00
|
|
|
url: "#",
|
2025-03-16 12:31:21 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
2025-06-17 09:05:15 +00:00
|
|
|
navSecondary: [
|
|
|
|
{
|
2025-06-19 08:07:40 +00:00
|
|
|
title: "帮助",
|
2025-06-17 09:05:15 +00:00
|
|
|
url: "/",
|
|
|
|
icon: LifeBuoy,
|
|
|
|
},
|
|
|
|
{
|
2025-06-19 08:07:40 +00:00
|
|
|
title: "反馈",
|
2025-06-17 09:05:15 +00:00
|
|
|
url: siteConfig.url.repo.github,
|
|
|
|
icon: Send,
|
|
|
|
},
|
|
|
|
],
|
2025-06-18 09:49:07 +00:00
|
|
|
wrongProblems: [
|
2025-03-16 12:31:21 +00:00
|
|
|
{
|
2025-06-18 09:49:07 +00:00
|
|
|
id: "abc123",
|
|
|
|
name: "Two Sum",
|
|
|
|
status: "WA",
|
2025-03-16 12:31:21 +00:00
|
|
|
},
|
|
|
|
{
|
2025-06-18 09:49:07 +00:00
|
|
|
id: "def456",
|
|
|
|
name: "Reverse Linked List",
|
|
|
|
status: "RE",
|
2025-03-16 12:31:21 +00:00
|
|
|
},
|
|
|
|
{
|
2025-06-18 09:49:07 +00:00
|
|
|
id: "ghi789",
|
|
|
|
name: "Binary Tree Paths",
|
|
|
|
status: "TLE",
|
2025-03-16 12:31:21 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2025-06-17 09:05:15 +00:00
|
|
|
export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
|
2025-03-16 12:31:21 +00:00
|
|
|
return (
|
2025-06-17 09:05:15 +00:00
|
|
|
<Sidebar variant="inset" {...props}>
|
2025-03-16 12:31:21 +00:00
|
|
|
<SidebarHeader>
|
2025-06-17 09:05:15 +00:00
|
|
|
<SidebarMenu>
|
|
|
|
<SidebarMenuItem>
|
|
|
|
<SidebarMenuButton size="lg" asChild>
|
|
|
|
<a href="#">
|
|
|
|
<div className="flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground">
|
|
|
|
<Command className="size-4" />
|
|
|
|
</div>
|
|
|
|
<div className="grid flex-1 text-left text-sm leading-tight">
|
|
|
|
<span className="truncate font-semibold">Judge4c</span>
|
|
|
|
<span className="truncate text-xs">Programming Learning</span>
|
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
</SidebarMenuButton>
|
|
|
|
</SidebarMenuItem>
|
|
|
|
</SidebarMenu>
|
2025-03-16 12:31:21 +00:00
|
|
|
</SidebarHeader>
|
|
|
|
<SidebarContent>
|
|
|
|
<NavMain items={data.navMain} />
|
2025-06-18 09:49:07 +00:00
|
|
|
<NavProjects projects={data.wrongProblems} />
|
2025-06-17 09:05:15 +00:00
|
|
|
<NavSecondary items={data.navSecondary} className="mt-auto" />
|
2025-03-16 12:31:21 +00:00
|
|
|
</SidebarContent>
|
|
|
|
<SidebarFooter>
|
2025-06-17 09:05:15 +00:00
|
|
|
<NavUser user={data.user} />
|
2025-03-16 12:31:21 +00:00
|
|
|
</SidebarFooter>
|
|
|
|
</Sidebar>
|
2025-06-17 09:05:15 +00:00
|
|
|
)
|
2025-06-19 08:07:40 +00:00
|
|
|
}
|