Organisation Switcher
component / auth / account
Searchable workspace switcher with per-organisation avatars, an async switch and a create action.
- type
- component
- files
- 1
- registry deps
- avatar, button, command, popover, skeleton
- npm deps
- lucide-react
installs
- components/automindz/org-switcher.tsx
- Async switch: trigger and row stay busy until it resolves
- Search matches name and meta line
- Suspended workspaces stay visible but blocked
onValueChange is awaited, so the trigger and the selected row stay busy while the tenant switch resolves. Mark a workspace disabled with a disabledReason instead of hiding it. appearance="compact" shows the avatar alone with the name in an sr-only label, for a collapsed @automindz/dashboard-shell rail; the popover is unchanged.
Variations
one state per section
Switching workspace
Pick another organisation: the row and the trigger stay busy until onValueChange resolves, because a tenant switch is not instant.
With a create action
onCreate appends a pinned action under the list, separated from the workspaces so it is never mistaken for one.
Loading
Same skeleton treatment as the user menu, so a sidebar assembles without shifting.
Suspended workspace
A blocked tenant is shown and disabled with a reason, rather than filtered out of a list the user knows should contain it.
