File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { Check , ChevronDown } from "lucide-react" ;
22import { NavLink } from "react-router" ;
33
4+ import { useWorkspace } from "~/components/WorkspaceProvider" ;
45import { Button } from "~/components/ui/button" ;
56import {
67 DropdownMenu ,
@@ -18,12 +19,9 @@ import {
1819
1920export const WorkspaceSelector : React . FC < {
2021 viewer : { email : string } ;
21- activeWorkspaceId ?: string | null ;
2222 workspaces : Array < { id : string ; slug : string ; name : string } > ;
23- } > = ( { viewer, activeWorkspaceId, workspaces } ) => {
24- const workspace =
25- workspaces . find ( ( w ) => w . id === activeWorkspaceId ) ?? workspaces . at ( 0 ) ;
26- if ( workspace == null ) return ;
23+ } > = ( { viewer, workspaces } ) => {
24+ const { workspace } = useWorkspace ( ) ;
2725 return (
2826 < DropdownMenu >
2927 < DropdownMenuTrigger asChild >
Original file line number Diff line number Diff line change @@ -196,11 +196,7 @@ export default function WorkspaceLayout() {
196196 < SidebarMenu >
197197 < SidebarMenuItem >
198198 { viewer != null && (
199- < WorkspaceSelector
200- viewer = { viewer }
201- activeWorkspaceId = { viewer . activeWorkspaceId }
202- workspaces = { workspaces }
203- />
199+ < WorkspaceSelector viewer = { viewer } workspaces = { workspaces } />
204200 ) }
205201 </ SidebarMenuItem >
206202 </ SidebarMenu >
You can’t perform that action at this time.
0 commit comments