implemented copy paste

This commit is contained in:
2021-08-16 01:42:29 +02:00
parent 4d85a419cc
commit 8344766ae3
4 changed files with 71 additions and 6 deletions

View File

@@ -6,11 +6,14 @@ export const CONTEXT_MENU_FILE = "CONTEXT_MENU_FILE"
export const CONTEXT_MENU_DIR = "CONTEXT_MENU_DIR"
export enum Action {
FileDelete
FileDelete,
FileCopy,
FilePaste
}
interface Props {
onSelect?: (action: Action, id: string)=>void
pasteActive?: boolean
}
const FileBrowserContextMenu: React.FC<Props> = (props) => {
@@ -25,7 +28,8 @@ const FileBrowserContextMenu: React.FC<Props> = (props) => {
<>
<Menu id={CONTEXT_MENU_FILE} animation={false}>
<Item onClick={onClick} data={Action.FileDelete} >Delete</Item>
<Item onClick={onClick} data="item2" >Item 2</Item>
<Item onClick={onClick} data={Action.FileCopy} >Copy</Item>
<Item onClick={onClick} data={Action.FilePaste} disabled={!props.pasteActive}>Paste</Item>
<Separator />
<Item disabled>Disabled</Item>
<Separator />