import PropTypes from 'prop-types' import { useSelectableEntity } from '../contexts/file-tree-selectable' import FileTreeItemInner from './file-tree-item/file-tree-item-inner' import { useTranslation } from 'react-i18next' import Icon from '../../../shared/components/icon' import iconTypeFromName from '../util/icon-type-from-name' import classnames from 'classnames' function FileTreeDoc({ name, id, isFile, isLinkedFile, shouldShowVisualSelection, }) { const { isSelected, props: selectableEntityProps } = useSelectableEntity( id, shouldShowVisualSelection, isFile ) return (
  • } />
  • ) } FileTreeDoc.propTypes = { name: PropTypes.string.isRequired, id: PropTypes.string.isRequired, isFile: PropTypes.bool, isLinkedFile: PropTypes.bool, shouldShowVisualSelection: PropTypes.bool, } export const FileTreeIcon = ({ isLinkedFile, name }) => { const { t } = useTranslation() const className = classnames('spaced', 'file-tree-icon', { 'linked-file-icon': isLinkedFile, }) return ( <>   {isLinkedFile && ( )} ) } FileTreeIcon.propTypes = { name: PropTypes.string.isRequired, isLinkedFile: PropTypes.bool, } export default FileTreeDoc