mirror of
https://github.com/fergalmoran/Readarr.git
synced 2026-01-12 11:44:02 +00:00
New: Show missing root folder path in edit for Import List (cherry picked from commit ae196af2ad368d49fde2358f0987ed7650c7f29c) Closes #821
61 lines
1.3 KiB
JavaScript
61 lines
1.3 KiB
JavaScript
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,
|
|
isMissing,
|
|
isMobile,
|
|
...otherProps
|
|
} = props;
|
|
|
|
const text = value === '' ? name : `${name} [${value}]`;
|
|
|
|
return (
|
|
<EnhancedSelectInputOption
|
|
isMobile={isMobile}
|
|
{...otherProps}
|
|
>
|
|
<div className={classNames(
|
|
styles.optionText,
|
|
isMobile && styles.isMobile
|
|
)}
|
|
>
|
|
<div>{text}</div>
|
|
|
|
{
|
|
freeSpace == null ?
|
|
null :
|
|
<div className={styles.freeSpace}>
|
|
{formatBytes(freeSpace)} Free
|
|
</div>
|
|
}
|
|
|
|
{
|
|
isMissing ?
|
|
<div className={styles.isMissing}>
|
|
Missing
|
|
</div> :
|
|
null
|
|
}
|
|
</div>
|
|
</EnhancedSelectInputOption>
|
|
);
|
|
}
|
|
|
|
RootFolderSelectInputOption.propTypes = {
|
|
name: PropTypes.string.isRequired,
|
|
value: PropTypes.string.isRequired,
|
|
freeSpace: PropTypes.number,
|
|
isMissing: PropTypes.bool,
|
|
isMobile: PropTypes.bool.isRequired
|
|
};
|
|
|
|
export default RootFolderSelectInputOption;
|