1 import type { ReactNode } from 'react';
2 import React, { createContext, useContext } from 'react';
4 import { useContextMenuControls } from '../hooks/useContextMenuControls';
8 handleContextMenu: (e: React.MouseEvent<Element>) => void;
9 handleContextMenuTouch: (e: React.TouchEvent<Element>) => void;
20 const FileBrowserItemContextMenuContext = createContext<Controls | null>(null);
26 export function FileBrowserItemContextMenuProvider({ children }: Props) {
27 const contextMenuControls = useContextMenuControls();
30 <FileBrowserItemContextMenuContext.Provider value={contextMenuControls}>
32 </FileBrowserItemContextMenuContext.Provider>
36 export function useItemContextMenu() {
37 const state = useContext(FileBrowserItemContextMenuContext);
39 throw new Error('Trying to use uninitialized FileBrowserItemContextMenuProvider');