refactor: optimize imports and add link component to app-sidebar

This commit is contained in:
ngc2207 2024-11-02 23:47:14 +08:00
parent 5b62062cba
commit 52277dec0d

View File

@ -1,6 +1,5 @@
"use client"; "use client";
import * as React from "react";
import { import {
BicepsFlexed, BicepsFlexed,
BookOpen, BookOpen,
@ -12,10 +11,12 @@ import {
Settings2, Settings2,
SquarePen, SquarePen,
} from "lucide-react"; } from "lucide-react";
import Link from "next/link";
import * as React from "react";
import { NavMain } from "@/components/nav-main"; import { NavMain } from "@/components/nav-main";
import { NavUser } from "@/components/nav-user";
import { NavProjects } from "@/components/nav-projects"; import { NavProjects } from "@/components/nav-projects";
import { NavSecondary } from "@/components/nav-secondary"; import { NavSecondary } from "@/components/nav-secondary";
import { NavUser } from "@/components/nav-user";
import { import {
Sidebar, Sidebar,
SidebarContent, SidebarContent,
@ -118,7 +119,7 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
<SidebarMenu> <SidebarMenu>
<SidebarMenuItem> <SidebarMenuItem>
<SidebarMenuButton size="lg" asChild> <SidebarMenuButton size="lg" asChild>
<a href="/dashboard"> <Link href="/">
<div className="flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground"> <div className="flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground">
<GraduationCap className="size-6" /> <GraduationCap className="size-6" />
</div> </div>
@ -126,7 +127,7 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
<span className="truncate font-semibold"></span> <span className="truncate font-semibold"></span>
<span className="truncate text-xs"></span> <span className="truncate text-xs"></span>
</div> </div>
</a> </Link>
</SidebarMenuButton> </SidebarMenuButton>
</SidebarMenuItem> </SidebarMenuItem>
</SidebarMenu> </SidebarMenu>