monaco-editor-lsp-next/src/components/app-sidebar.tsx

155 lines
3.2 KiB
TypeScript
Raw Normal View History

2025-06-17 09:05:15 +00:00
"use client"
import { siteConfig } from "@/config/site"
import * as React from "react"
import {
2025-06-17 09:05:15 +00:00
BookOpen,
Command,
Frame,
2025-06-17 09:05:15 +00:00
LifeBuoy,
Map,
PieChart,
2025-06-17 09:05:15 +00:00
Send,
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"
import {
Sidebar,
SidebarContent,
SidebarFooter,
SidebarHeader,
2025-06-17 09:05:15 +00:00
SidebarMenu,
SidebarMenuButton,
SidebarMenuItem,
} from "@/components/ui/sidebar"
const data = {
2025-06-17 09:05:15 +00:00
user: {
name: "shadcn",
email: "m@example.com",
avatar: "/avatars/shadcn.jpg",
},
navMain: [
{
2025-06-17 09:05:15 +00:00
title: "Dashboard",
url: "#",
icon: SquareTerminal,
isActive: true,
2025-06-17 09:05:15 +00:00
items: [
{
title: "Home",
url: "/",
},
{
title: "Personal interface",
url: "#",
},
{
title: "Problems",
url: "/problemset",
},
],
},
2025-06-17 09:05:15 +00:00
{
2025-06-17 09:05:15 +00:00
title: "Done Topics",
url: "#",
2025-06-17 09:05:15 +00:00
icon: BookOpen,
items: [
{
2025-06-17 09:05:15 +00:00
title: "All Coding",
url: "#",
},
{
2025-06-17 09:05:15 +00:00
title: "Correct Codingset",
url: "#",
},
{
2025-06-17 09:05:15 +00:00
title: "Wrong Codingset",
url: "#",
},
],
},
{
title: "Settings",
2025-06-17 09:05:15 +00:00
url: "#",
icon: Settings2,
items: [
{
title: "General",
2025-06-17 09:05:15 +00:00
url: "#",
},
{
2025-06-17 09:05:15 +00:00
title: "Language",
url: "#",
},
],
},
],
2025-06-17 09:05:15 +00:00
navSecondary: [
{
title: "Support",
url: "/",
icon: LifeBuoy,
},
{
title: "Feedback",
url: siteConfig.url.repo.github,
icon: Send,
},
],
projects: [
{
name: "Design Engineering",
url: "#",
icon: Frame,
},
{
name: "Sales & Marketing",
url: "#",
icon: PieChart,
},
{
name: "Travel",
url: "#",
icon: Map,
},
],
}
2025-06-17 09:05:15 +00:00
export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
return (
2025-06-17 09:05:15 +00:00
<Sidebar variant="inset" {...props}>
<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>
</SidebarHeader>
<SidebarContent>
<NavMain items={data.navMain} />
<NavProjects projects={data.projects} />
2025-06-17 09:05:15 +00:00
<NavSecondary items={data.navSecondary} className="mt-auto" />
</SidebarContent>
<SidebarFooter>
2025-06-17 09:05:15 +00:00
<NavUser user={data.user} />
</SidebarFooter>
</Sidebar>
2025-06-17 09:05:15 +00:00
)
}