the big refactor 2: ObjID
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React from "react"
|
||||
import { Item, ItemParams, Menu, Separator } from "react-contexify"
|
||||
|
||||
import ObjID from "../types/ObjID"
|
||||
|
||||
export const CONTEXT_MENU_FILE = "CONTEXT_MENU_FILE"
|
||||
export const CONTEXT_MENU_DIR = "CONTEXT_MENU_DIR"
|
||||
@@ -16,12 +16,12 @@ export enum Action {
|
||||
}
|
||||
|
||||
interface Props {
|
||||
onSelect?: (action: Action, id: string)=>void
|
||||
onSelect?: (action: Action, id: ObjID)=>void
|
||||
pasteActive?: boolean
|
||||
}
|
||||
|
||||
const FileBrowserContextMenu: React.FC<Props> = (props) => {
|
||||
function onClick({ props: itemProps, data }: ItemParams<{id:string}, Action>) {
|
||||
function onClick({ props: itemProps, data }: ItemParams<{id:ObjID}, Action>) {
|
||||
if (itemProps?.id && data != null){
|
||||
props.onSelect?.(data,itemProps.id)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user