team-switcher.tsx — ui Source File
Architecture documentation for team-switcher.tsx, a tsx file in the ui codebase. 4 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 4d16a204_a632_8e46_e515_0dd0df005a86["team-switcher.tsx"] 1d141819_425e_b5fd_4c8e_32f7c6a42cf2["react"] 4d16a204_a632_8e46_e515_0dd0df005a86 --> 1d141819_425e_b5fd_4c8e_32f7c6a42cf2 d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3["lucide-react"] 4d16a204_a632_8e46_e515_0dd0df005a86 --> d39cd1e4_1b2d_9aa2_1d29_fd0b4bfb61c3 f16f43cb_04fd_5f33_2140_7eafce119350["dropdown-menu"] 4d16a204_a632_8e46_e515_0dd0df005a86 --> f16f43cb_04fd_5f33_2140_7eafce119350 742f06fb_c1e8_243e_1fc4_8b1cf11704c2["sidebar"] 4d16a204_a632_8e46_e515_0dd0df005a86 --> 742f06fb_c1e8_243e_1fc4_8b1cf11704c2 style 4d16a204_a632_8e46_e515_0dd0df005a86 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
"use client"
import * as React from "react"
import { ChevronDown, Plus } from "lucide-react"
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuShortcut,
DropdownMenuTrigger,
} from "@/registry/default/ui/dropdown-menu"
import {
SidebarMenu,
SidebarMenuButton,
SidebarMenuItem,
} from "@/registry/default/ui/sidebar"
export function TeamSwitcher({
teams,
}: {
teams: {
name: string
logo: React.ElementType
plan: string
}[]
}) {
const [activeTeam, setActiveTeam] = React.useState(teams[0])
if (!activeTeam) {
return null
}
return (
<SidebarMenu>
<SidebarMenuItem>
<DropdownMenu>
<DropdownMenuTrigger asChild>
<SidebarMenuButton className="w-fit px-1.5">
<div className="flex aspect-square size-5 items-center justify-center rounded-md bg-sidebar-primary text-sidebar-primary-foreground">
<activeTeam.logo className="size-3" />
</div>
<span className="truncate font-semibold">{activeTeam.name}</span>
<ChevronDown className="opacity-50" />
</SidebarMenuButton>
</DropdownMenuTrigger>
<DropdownMenuContent
className="w-64 rounded-lg"
align="start"
side="bottom"
sideOffset={4}
>
<DropdownMenuLabel className="text-xs text-muted-foreground">
Teams
</DropdownMenuLabel>
{teams.map((team, index) => (
<DropdownMenuItem
key={team.name}
onClick={() => setActiveTeam(team)}
className="gap-2 p-2"
>
<div className="flex size-6 items-center justify-center rounded-sm border">
<team.logo className="size-4 shrink-0" />
</div>
{team.name}
<DropdownMenuShortcut>⌘{index + 1}</DropdownMenuShortcut>
</DropdownMenuItem>
))}
<DropdownMenuSeparator />
<DropdownMenuItem className="gap-2 p-2">
<div className="flex size-6 items-center justify-center rounded-md border bg-background">
<Plus className="size-4" />
</div>
<div className="font-medium text-muted-foreground">Add team</div>
</DropdownMenuItem>
</DropdownMenuContent>
</DropdownMenu>
</SidebarMenuItem>
</SidebarMenu>
)
}
Domain
Subdomains
Functions
Dependencies
- dropdown-menu
- lucide-react
- react
- sidebar
Source
Frequently Asked Questions
What does team-switcher.tsx do?
team-switcher.tsx is a source file in the ui codebase, written in tsx. It belongs to the ComponentRegistry domain, ChartRegistry subdomain.
What functions are defined in team-switcher.tsx?
team-switcher.tsx defines 1 function(s): TeamSwitcher.
What does team-switcher.tsx depend on?
team-switcher.tsx imports 4 module(s): dropdown-menu, lucide-react, react, sidebar.
Where is team-switcher.tsx in the architecture?
team-switcher.tsx is located at deprecated/www/registry/default/blocks/sidebar-10/components/team-switcher.tsx (domain: ComponentRegistry, subdomain: ChartRegistry, directory: deprecated/www/registry/default/blocks/sidebar-10/components).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free