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