mirror of
https://github.com/eliasstepanik/core.git
synced 2026-01-10 23:58:28 +00:00
61 lines
1.3 KiB
TypeScript
61 lines
1.3 KiB
TypeScript
import * as React from "react";
|
|
|
|
import {
|
|
Sidebar,
|
|
SidebarContent,
|
|
SidebarFooter,
|
|
SidebarHeader,
|
|
SidebarMenu,
|
|
SidebarMenuItem,
|
|
} from "../ui/sidebar";
|
|
import { DashboardIcon } from "@radix-ui/react-icons";
|
|
import { Code, Search } from "lucide-react";
|
|
import { NavMain } from "./nav-main";
|
|
import { useUser } from "~/hooks/useUser";
|
|
import { NavUser } from "./nav-user";
|
|
import { useWorkspace } from "~/hooks/useWorkspace";
|
|
|
|
const data = {
|
|
navMain: [
|
|
{
|
|
title: "Dashboard",
|
|
url: "/home/dashboard",
|
|
icon: DashboardIcon,
|
|
},
|
|
{
|
|
title: "API",
|
|
url: "/home/api",
|
|
icon: Code,
|
|
},
|
|
{
|
|
title: "Logs",
|
|
url: "/home/logs",
|
|
icon: Search,
|
|
},
|
|
],
|
|
};
|
|
|
|
export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
|
|
const user = useUser();
|
|
const workspace = useWorkspace();
|
|
|
|
return (
|
|
<Sidebar collapsible="offcanvas" {...props} className="bg-background">
|
|
<SidebarHeader>
|
|
<SidebarMenu>
|
|
<SidebarMenuItem>
|
|
<span className="text-base font-semibold">{workspace.name}</span>
|
|
</SidebarMenuItem>
|
|
</SidebarMenu>
|
|
</SidebarHeader>
|
|
<SidebarContent>
|
|
<NavMain items={data.navMain} />
|
|
</SidebarContent>
|
|
|
|
<SidebarFooter className="p-0">
|
|
<NavUser user={user} />
|
|
</SidebarFooter>
|
|
</Sidebar>
|
|
);
|
|
}
|