feat(app-sidebar): replace TeamSwitcher with WorkspaceSwitcher in sidebar component

This commit is contained in:
ngc2207 2025-02-06 09:21:51 +08:00
parent 94f49eefd9
commit 67a93aa671

View File

@ -1,23 +1,15 @@
"use client"; "use client";
import * as React from "react";
import { import {
AudioWaveform,
BookOpen, BookOpen,
Bot, Bot,
Command,
Frame, Frame,
GalleryVerticalEnd,
Map, Map,
PieChart, PieChart,
Settings2, Settings2,
SquareTerminal, SquareTerminal,
} from "lucide-react"; } from "lucide-react";
import * as React from "react";
import { NavMain } from "@/components/nav-main";
import { NavProjects } from "@/components/nav-projects";
import { NavUser } from "@/components/nav-user";
import { TeamSwitcher } from "@/components/team-switcher";
import { import {
Sidebar, Sidebar,
SidebarContent, SidebarContent,
@ -25,26 +17,13 @@ import {
SidebarHeader, SidebarHeader,
SidebarRail, SidebarRail,
} from "@/components/ui/sidebar"; } from "@/components/ui/sidebar";
import { NavMain } from "@/components/nav-main";
import { NavUser } from "@/components/nav-user";
import { NavProjects } from "@/components/nav-projects";
import { WorkspaceSwitcher } from "@/components/workspace-switcher";
// This is sample data. // This is sample data.
const data = { const data = {
teams: [
{
name: "Acme Inc",
logo: GalleryVerticalEnd,
plan: "Enterprise",
},
{
name: "Acme Corp.",
logo: AudioWaveform,
plan: "Startup",
},
{
name: "Evil Corp.",
logo: Command,
plan: "Free",
},
],
navMain: [ navMain: [
{ {
title: "Playground", title: "Playground",
@ -155,7 +134,7 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
return ( return (
<Sidebar collapsible="icon" {...props}> <Sidebar collapsible="icon" {...props}>
<SidebarHeader> <SidebarHeader>
<TeamSwitcher teams={data.teams} /> <WorkspaceSwitcher />
</SidebarHeader> </SidebarHeader>
<SidebarContent> <SidebarContent>
<NavMain items={data.navMain} /> <NavMain items={data.navMain} />