diff --git a/libs/remix-ui/workspace/src/lib/components/file-explorer-hovericons.tsx b/libs/remix-ui/workspace/src/lib/components/file-explorer-hovericons.tsx new file mode 100644 index 0000000000..61485287b4 --- /dev/null +++ b/libs/remix-ui/workspace/src/lib/components/file-explorer-hovericons.tsx @@ -0,0 +1,100 @@ +import React, { useState } from 'react' +import { CustomTooltip } from '@remix-ui/helper' +import { FormattedMessage } from 'react-intl' +import { ROOT_PATH } from '../utils/constants' + +export type FileHoverIconsProps = { + hover: boolean + isEditable: boolean + file: any + handleNewFolderOp: any + handleNewFileOp: any + renamePathOp: any + deletePathOp: any +} + +export function FileHoverIcons(props: FileHoverIconsProps) { + + return ( + <> + {(props.hover && !props.isEditable) &&
+ { + props.file.isDirectory ? ( + <> + } + tooltipId={`filePanel.edit.${props.file.path}`} + tooltipClasses="text-nowrap" + > + { + e.stopPropagation() + console.log(props) + await props.handleNewFolderOp(props.file.path) + console.log('clicked on folder icon') + }} + > + + } + tooltipId={`fileExplorer.edit.${props.file.path}`} + tooltipClasses="text-nowrap" + > + { + e.stopPropagation() + await props.handleNewFileOp(props.file.path) + console.log('clicked on file icon') + }} + > + + + ) : null + } + } + tooltipId={`fileExplorer.edit.${props.file.path}`} + tooltipClasses="text-nowrap" + > + { + e.stopPropagation() + console.log(props) + console.log(e) + await props.renamePathOp(props.file.path, props.file.type) + console.log('clicked on edit icon') + }} + > + + } + tooltipId={`fileExplorer.edit.${props.file.path}`} + tooltipClasses="text-nowrap" + > + { + e.stopPropagation() + console.log(props) + console.log(e) + console.log('clicked on trash icon') + await props.deletePathOp(props.file.path) + }} + > + +
+ } + + ) +}