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