import { memo, useRef, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { FaAngleRight, FaFile } from 'react-icons/fa'; import useContextMenu from '../hooks/useContextMenu'; import { primaryTextColor } from '../colors'; const BatchFile = memo(({ path, isOpen, isSelected, name, onSelect, onDelete }: { path: string, isOpen: boolean, isSelected: boolean, name: string, onSelect: (a: string) => void, onDelete: (a: string) => void }) => { const ref = useRef(null); const { t } = useTranslation(); const contextMenuTemplate = useMemo(() => [ { label: t('Remove'), click: () => onDelete(path) }, ], [t, onDelete, path]); useContextMenu(ref, contextMenuTemplate); return (
onSelect(path)}>
{name}
{isOpen && }
); }); export default BatchFile;