({
+ root: {
+ width: "100%",
+ backgroundColor: theme.palette.background.default,
+ color: "black",
+ zIndex: 2
+ },
+}));
+
+export const ContextMenu = ({ open, onClose, handleClickAway, options }) => {
+ const classes = useStyles();
+ return (
+
+
+
+
+ {options.map((option) => (
+ {
+ option.onClick(e, option);
+ onClose();
+ }}
+ >
+ {option.icon}
+
+
+ ))}
+
+
+
+
+ );
+};
diff --git a/src/ui/hooks/useContextMenu.js b/src/ui/hooks/useContextMenu.js
new file mode 100644
index 0000000..456fd27
--- /dev/null
+++ b/src/ui/hooks/useContextMenu.js
@@ -0,0 +1,9 @@
+import React, { useState } from "react";
+import { ContextMenu } from "../components/ContextMenu";
+
+export const useContextMenu = (options = []) => {
+ const [open, setOpen] = useState();
+ const onClose = () => setOpen(false);
+ const onOpen = () => setOpen(true);
+ return [onOpen, onClose, () =>
, open]
+};
\ No newline at end of file