diff --git a/src/components/workspace-switcher.tsx b/src/components/workspace-switcher.tsx index e971aea..c275786 100644 --- a/src/components/workspace-switcher.tsx +++ b/src/components/workspace-switcher.tsx @@ -32,13 +32,14 @@ export function WorkspaceSwitcher() { setActiveWorkspace(workspaces?.documents[0]); }, [workspaces]); - if (!activeWorkspace) + if (!workspaces) { return (
); + } return ( @@ -49,20 +50,37 @@ export function WorkspaceSwitcher() { size="lg" className="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground" > -
- -
-
- - {activeWorkspace.name} - - {/* */} -
- + {workspaces.documents.length === 0 ? ( + <> +
+ +
+
+ + Add workspace + + {/* */} +
+ + + ) : ( + <> +
+ +
+
+ + {activeWorkspace?.name ?? ""} + + {/* */} +
+ + + )}