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";
import * as React from "react";
import {
BicepsFlexed,
BookOpen,
@ -12,10 +11,12 @@ import {
Settings2,
SquarePen,
} from "lucide-react";
import Link from "next/link";
import * as React from "react";
import { NavMain } from "@/components/nav-main";
import { NavUser } from "@/components/nav-user";
import { NavProjects } from "@/components/nav-projects";
import { NavSecondary } from "@/components/nav-secondary";
import { NavUser } from "@/components/nav-user";
import {
Sidebar,
SidebarContent,
@ -118,7 +119,7 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
<SidebarMenu>
<SidebarMenuItem>
<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">
<GraduationCap className="size-6" />
</div>
@ -126,7 +127,7 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
<span className="truncate font-semibold"></span>
<span className="truncate text-xs"></span>
</div>
</a>
</Link>
</SidebarMenuButton>
</SidebarMenuItem>
</SidebarMenu>