@@ -6,11 +6,12 @@ import { useRecentCluster } from '@/hooks/useCluster';
6
6
import { bindings } from '@/main' ;
7
7
import { formatAsDuration , upperFirst } from '@/utils' ;
8
8
import { useCommand , useCommandMut , useCommandSuspense } from '@onelauncher/common' ;
9
- import { Button , Show } from '@onelauncher/common/components' ;
9
+ import { Button , ContextMenu , Show } from '@onelauncher/common/components' ;
10
10
import { createFileRoute , Link } from '@tanstack/react-router' ;
11
11
import { convertFileSrc } from '@tauri-apps/api/core' ;
12
12
import { PlayIcon } from '@untitled-theme/icons-react' ;
13
13
import { OverlayScrollbarsComponent } from 'overlayscrollbars-react' ;
14
+ import { useRef , useState } from 'react' ;
14
15
15
16
export const Route = createFileRoute ( '/app/' ) ( {
16
17
component : RouteComponent ,
@@ -167,6 +168,8 @@ function ClusterCard({
167
168
icon_url,
168
169
stage,
169
170
} : ClusterModel ) {
171
+ const ref = useRef < HTMLDivElement > ( null ) ;
172
+ const [ isOpen , setOpen ] = useState ( false ) ;
170
173
const launch = useCommandMut ( ( ) => bindings . core . launchCluster ( id , null ) ) ;
171
174
172
175
const handleLaunch = ( ) => {
@@ -186,7 +189,7 @@ function ClusterCard({
186
189
} ;
187
190
188
191
return (
189
- < >
192
+ < div ref = { ref } >
190
193
< Link
191
194
disabled = { stage === 'downloading' }
192
195
search = { {
@@ -227,6 +230,33 @@ function ClusterCard({
227
230
</ div >
228
231
</ div >
229
232
</ Link >
230
- </ >
233
+
234
+ < ContextMenu
235
+ isOpen = { isOpen }
236
+ setOpen = { setOpen }
237
+ triggerRef = { ref }
238
+ >
239
+ < ContextMenu . Item className = "" >
240
+ Launch
241
+ </ ContextMenu . Item >
242
+ < ContextMenu . Separator />
243
+ < ContextMenu . Item className = "" >
244
+ Rename
245
+ </ ContextMenu . Item >
246
+ < ContextMenu . Item className = "" >
247
+ Change Icon
248
+ </ ContextMenu . Item >
249
+ < ContextMenu . Separator />
250
+ < ContextMenu . Item className = "" >
251
+ Properties
252
+ </ ContextMenu . Item >
253
+ < ContextMenu . Item className = "text-red-500" >
254
+ Delete
255
+ </ ContextMenu . Item >
256
+ { /* <ContextMenu.Item className="">
257
+ Export
258
+ </ContextMenu.Item> */ }
259
+ </ ContextMenu >
260
+ </ div >
231
261
) ;
232
262
}
0 commit comments