diff --git a/apps/web/app/routes/ws/_components/WorkspaceSelector.tsx b/apps/web/app/routes/ws/_components/WorkspaceSelector.tsx index bace15de2..47cfc536d 100644 --- a/apps/web/app/routes/ws/_components/WorkspaceSelector.tsx +++ b/apps/web/app/routes/ws/_components/WorkspaceSelector.tsx @@ -1,6 +1,7 @@ import { Check, ChevronDown } from "lucide-react"; import { NavLink } from "react-router"; +import { useWorkspace } from "~/components/WorkspaceProvider"; import { Button } from "~/components/ui/button"; import { DropdownMenu, @@ -18,12 +19,9 @@ import { export const WorkspaceSelector: React.FC<{ viewer: { email: string }; - activeWorkspaceId?: string | null; workspaces: Array<{ id: string; slug: string; name: string }>; -}> = ({ viewer, activeWorkspaceId, workspaces }) => { - const workspace = - workspaces.find((w) => w.id === activeWorkspaceId) ?? workspaces.at(0); - if (workspace == null) return; +}> = ({ viewer, workspaces }) => { + const { workspace } = useWorkspace(); return ( diff --git a/apps/web/app/routes/ws/_layout.tsx b/apps/web/app/routes/ws/_layout.tsx index 6067b4409..b37d23bd9 100644 --- a/apps/web/app/routes/ws/_layout.tsx +++ b/apps/web/app/routes/ws/_layout.tsx @@ -196,11 +196,7 @@ export default function WorkspaceLayout() { {viewer != null && ( - + )}