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, artistFolder, isMobile, isWindows, ...otherProps } = props; const slashCharacter = isWindows ? '\\' : '/'; const text = value === '' ? name : `[${name}] ${value}`; console.debug(props); return (
{text} { artistFolder && id !== 'addNew' ?
{slashCharacter} {artistFolder}
: null }
{ freeSpace != null &&
{formatBytes(freeSpace)} Free
}
); } RootFolderSelectInputOption.propTypes = { id: PropTypes.string.isRequired, name: PropTypes.string.isRequired, value: PropTypes.string.isRequired, freeSpace: PropTypes.number, artistFolder: PropTypes.string, isMobile: PropTypes.bool.isRequired, isWindows: PropTypes.bool }; export default RootFolderSelectInputOption;