@@ -6,11 +6,12 @@ import { useRecentCluster } from '@/hooks/useCluster';
66import { bindings } from '@/main' ;
77import { formatAsDuration , upperFirst } from '@/utils' ;
88import { useCommand , useCommandMut , useCommandSuspense } from '@onelauncher/common' ;
9- import { Button , Show } from '@onelauncher/common/components' ;
9+ import { Button , ContextMenu , Show } from '@onelauncher/common/components' ;
1010import { createFileRoute , Link } from '@tanstack/react-router' ;
1111import { convertFileSrc } from '@tauri-apps/api/core' ;
1212import { PlayIcon } from '@untitled-theme/icons-react' ;
1313import { OverlayScrollbarsComponent } from 'overlayscrollbars-react' ;
14+ import { useRef , useState } from 'react' ;
1415
1516export const Route = createFileRoute ( '/app/' ) ( {
1617 component : RouteComponent ,
@@ -167,6 +168,8 @@ function ClusterCard({
167168 icon_url,
168169 stage,
169170} : ClusterModel ) {
171+ const ref = useRef < HTMLDivElement > ( null ) ;
172+ const [ isOpen , setOpen ] = useState ( false ) ;
170173 const launch = useCommandMut ( ( ) => bindings . core . launchCluster ( id , null ) ) ;
171174
172175 const handleLaunch = ( ) => {
@@ -186,7 +189,7 @@ function ClusterCard({
186189 } ;
187190
188191 return (
189- < >
192+ < div ref = { ref } >
190193 < Link
191194 disabled = { stage === 'downloading' }
192195 search = { {
@@ -227,6 +230,33 @@ function ClusterCard({
227230 </ div >
228231 </ div >
229232 </ 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 >
231261 ) ;
232262}
0 commit comments