1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-20 21:54:58 -04:00

Created generic Hinted EnhancedSelectInput components and use it instead of SelectInput

This commit is contained in:
Taloth Saldono
2019-06-16 15:36:11 +02:00
committed by Taloth
parent d3662f2302
commit 1af3e0bd93
11 changed files with 175 additions and 22 deletions
@@ -0,0 +1,43 @@
import PropTypes from 'prop-types';
import React from 'react';
import EnhancedSelectInputSelectedValue from './EnhancedSelectInputSelectedValue';
import styles from './HintedSelectInputSelectedValue.css';
function HintedSelectInputSelectedValue(props) {
const {
value,
hint,
includeHint,
...otherProps
} = props;
return (
<EnhancedSelectInputSelectedValue
className={styles.selectedValue}
{...otherProps}
>
<div className={styles.valueText}>
{value}
</div>
{
hint != null && includeHint &&
<div className={styles.hintText}>
{hint}
</div>
}
</EnhancedSelectInputSelectedValue>
);
}
HintedSelectInputSelectedValue.propTypes = {
value: PropTypes.string,
hint: PropTypes.string,
includeHint: PropTypes.bool.isRequired
};
HintedSelectInputSelectedValue.defaultProps = {
includeHint: true
};
export default HintedSelectInputSelectedValue;