mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
66 lines
1.5 KiB
JavaScript
66 lines
1.5 KiB
JavaScript
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,
|
|
movieFolder,
|
|
isMobile,
|
|
isWindows,
|
|
...otherProps
|
|
} = props;
|
|
|
|
const slashCharacter = isWindows ? '\\' : '/';
|
|
|
|
return (
|
|
<EnhancedSelectInputOption
|
|
id={id}
|
|
isMobile={isMobile}
|
|
{...otherProps}
|
|
>
|
|
<div className={classNames(
|
|
styles.optionText,
|
|
isMobile && styles.isMobile
|
|
)}
|
|
>
|
|
<div className={styles.value}>
|
|
{value}
|
|
|
|
{
|
|
movieFolder && id !== 'addNew' ?
|
|
<div className={styles.movieFolder}>
|
|
{slashCharacter}
|
|
{movieFolder}
|
|
</div> :
|
|
null
|
|
}
|
|
</div>
|
|
|
|
{
|
|
freeSpace != null &&
|
|
<div className={styles.freeSpace}>
|
|
{formatBytes(freeSpace)} Free
|
|
</div>
|
|
}
|
|
</div>
|
|
</EnhancedSelectInputOption>
|
|
);
|
|
}
|
|
|
|
RootFolderSelectInputOption.propTypes = {
|
|
id: PropTypes.string.isRequired,
|
|
value: PropTypes.string.isRequired,
|
|
freeSpace: PropTypes.number,
|
|
movieFolder: PropTypes.string,
|
|
isMobile: PropTypes.bool.isRequired,
|
|
isWindows: PropTypes.bool
|
|
};
|
|
|
|
export default RootFolderSelectInputOption;
|