@@ -16,6 +16,8 @@ import { useState } from "react";
16
16
import { useMutationActivateWorkspace } from "../hooks/use-mutation-activate-workspace" ;
17
17
import clsx from "clsx" ;
18
18
import { useActiveWorkspaceName } from "../hooks/use-active-workspace-name" ;
19
+ import { hrefs } from "@/lib/hrefs" ;
20
+ import { twMerge } from "tailwind-merge" ;
19
21
20
22
export function WorkspacesSelection ( ) {
21
23
const queryClient = useQueryClient ( ) ;
@@ -46,7 +48,7 @@ export function WorkspacesSelection() {
46
48
< ChevronDown />
47
49
</ Button >
48
50
49
- < Popover className = "w-1/4 p-4 " placement = "bottom left" >
51
+ < Popover className = "w-[32rem] p-3 " placement = "bottom left" >
50
52
< div >
51
53
< div >
52
54
< SearchField
@@ -65,7 +67,7 @@ export function WorkspacesSelection() {
65
67
onAction = { ( v ) => {
66
68
handleWorkspaceClick ( v ?. toString ( ) ) ;
67
69
} }
68
- className = "py-2 pt-3 max-h-80 overflow-auto"
70
+ className = "-mx-1 my-2 max-h-80 overflow-auto"
69
71
renderEmptyState = { ( ) => (
70
72
< p className = "text-center" > No workspaces found</ p >
71
73
) }
@@ -74,16 +76,36 @@ export function WorkspacesSelection() {
74
76
< ListBoxItem
75
77
id = { item . name }
76
78
key = { item . name }
79
+ textValue = { item . name }
77
80
data-is-selected = { item . name === activeWorkspaceName }
78
81
className = { clsx (
79
- "cursor-pointer py-2 m-1 text-base hover:bg-gray-300 " ,
82
+ "grid grid-cols-[auto_1.5rem] group/selector cursor-pointer py-2 m-1 text-base hover:bg-gray-200 rounded-sm " ,
80
83
{
81
84
"!bg-gray-900 hover:bg-gray-900 !text-gray-25 hover:!text-gray-25" :
82
85
item . is_active ,
83
86
} ,
84
87
) }
85
88
>
86
- { item . name }
89
+ < span className = "block truncate" > { item . name } </ span >
90
+
91
+ < LinkButton
92
+ href = { hrefs . workspaces . edit ( item . name ) }
93
+ onPress = { ( ) => setIsOpen ( false ) }
94
+ isIcon
95
+ variant = "tertiary"
96
+ className = { twMerge (
97
+ "ml-auto size-6 group-hover/selector:opacity-100 opacity-0 transition-opacity" ,
98
+ item . is_active
99
+ ? "hover:bg-gray-800 pressed:bg-gray-700"
100
+ : "hover:bg-gray-50 hover:text-primary" ,
101
+ ) }
102
+ >
103
+ < Settings
104
+ className = { twMerge (
105
+ item . is_active ? "text-gray-25" : "text-secondary" ,
106
+ ) }
107
+ />
108
+ </ LinkButton >
87
109
</ ListBoxItem >
88
110
) }
89
111
</ ListBox >
@@ -92,7 +114,7 @@ export function WorkspacesSelection() {
92
114
href = "/workspaces"
93
115
onPress = { ( ) => setIsOpen ( false ) }
94
116
variant = "tertiary"
95
- className = "text-secondary h-8 pl-2 gap-2 flex mt-2 justify-start"
117
+ className = "text-secondary h-10 pl-2 gap-2 flex mt-2 justify-start"
96
118
>
97
119
< Settings />
98
120
Manage Workspaces
0 commit comments