Refactor context menu handler into hook

This commit is contained in:
jeffvli 2023-01-07 18:16:19 -08:00
parent 2edffa02d0
commit 7d8cb0bb45
11 changed files with 88 additions and 191 deletions

View file

@ -1,9 +1,14 @@
import { RowNode } from '@ag-grid-community/core';
import type { AgGridReact as AgGridReactType } from '@ag-grid-community/react/lib/agGridReact';
import { createUseExternalEvents } from '@mantine/utils';
import { MutableRefObject } from 'react';
import { LibraryItem } from '/@/renderer/api/types';
export type OpenContextMenuProps = {
data: any[];
dataNodes?: RowNode[];
menuItems: SetContextMenuItems;
tableRef?: MutableRefObject<AgGridReactType | null>;
type: LibraryItem;
xPos: number;
yPos: number;