updated orchestion to handle updating and deleting sessions

This commit is contained in:
Storme-bit
2026-04-13 03:04:29 -07:00
parent f6d538f68a
commit 3c6cfa9bf4
5 changed files with 80 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
import { useState, useEffect, useCallback } from 'react';
export function useContextMenu() {
const [menu, setMenu] = useState(null); // { x, y, session }
const open = useCallback((e, session) => {
e.preventDefault();
setMenu({ x: e.clientX, y: e.clientY, session });
}, []);
const close = useCallback(() => setMenu(null), []);
// Close on any click outside
useEffect(() => {
if (!menu) return;
const handler = () => close();
window.addEventListener('click', handler);
return () => window.removeEventListener('click', handler);
}, [menu, close]);
return { menu, open, close };
}