feat: global ui & functional update
This commit is contained in:
@@ -107,19 +107,23 @@ export function NavUser({
|
||||
{workspaceSwitcher.workspaces.length > 0 ? (
|
||||
workspaceSwitcher.workspaces.map((workspace) => {
|
||||
const isDemo = workspace.id === DEMO_WORKSPACE_ID;
|
||||
const isSelected = workspaceSwitcher.currentWorkspaceId === workspace.id;
|
||||
return (
|
||||
<DropdownMenuItem
|
||||
key={workspace.id}
|
||||
onClick={() => workspaceSwitcher.onSelect(workspace)}
|
||||
className="gap-2 p-2 text-sm"
|
||||
>
|
||||
<div className="flex size-6 items-center justify-center rounded-sm border">
|
||||
{isDemo ? (
|
||||
<Sparkles className="size-4 shrink-0 text-purple-500" />
|
||||
) : (
|
||||
<Building2 className="size-4 shrink-0" />
|
||||
)}
|
||||
</div>
|
||||
<Avatar className="h-6 w-6 rounded-sm">
|
||||
<AvatarImage src={workspace.avatar_url || undefined} alt={workspace.name} />
|
||||
<AvatarFallback className="rounded-sm text-xs">
|
||||
{isDemo ? (
|
||||
<Sparkles className="h-3 w-3 text-purple-500" />
|
||||
) : (
|
||||
workspace.name.charAt(0).toUpperCase()
|
||||
)}
|
||||
</AvatarFallback>
|
||||
</Avatar>
|
||||
<span className="flex-1 truncate">
|
||||
{workspace.name}
|
||||
{isDemo && (
|
||||
@@ -128,7 +132,7 @@ export function NavUser({
|
||||
</span>
|
||||
)}
|
||||
</span>
|
||||
{workspaceSwitcher.currentWorkspaceId === workspace.id && (
|
||||
{isSelected && (
|
||||
<Check className="size-4 ml-auto" />
|
||||
)}
|
||||
</DropdownMenuItem>
|
||||
|
||||
Reference in New Issue
Block a user