mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00

Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com> Co-Authored-By: taloth <taloth@users.noreply.github.com>
44 lines
967 B
JavaScript
44 lines
967 B
JavaScript
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;
|