import classNames from 'classnames'; import PropTypes from 'prop-types'; import React from 'react'; import formatBytes from 'Utilities/Number/formatBytes'; import EnhancedSelectInputOption from './EnhancedSelectInputOption'; import styles from './RootFolderSelectInputOption.css'; function RootFolderSelectInputOption(props) { const { id, value, name, freeSpace, isMissing, artistFolder, isMobile, isWindows, ...otherProps } = props; const slashCharacter = isWindows ? '\\' : '/'; const text = name === '' ? value : `[${name}] ${value}`; return (
{text} { artistFolder && id !== 'addNew' ?
{slashCharacter} {artistFolder}
: null }
{ freeSpace == null ? null :
{formatBytes(freeSpace)} Free
} { isMissing ?
Missing
: null }
); } RootFolderSelectInputOption.propTypes = { id: PropTypes.string.isRequired, name: PropTypes.string.isRequired, value: PropTypes.string.isRequired, freeSpace: PropTypes.number, isMissing: PropTypes.bool, artistFolder: PropTypes.string, isMobile: PropTypes.bool.isRequired, isWindows: PropTypes.bool }; RootFolderSelectInputOption.defaultProps = { name: '' }; export default RootFolderSelectInputOption;