mirror of
https://github.com/Prowlarr/Prowlarr
synced 2025-12-06 08:34:28 +01:00
Display the link to application only if it's enabled Thanks to higa on discord for pointing this to us.
74 lines
1.5 KiB
JavaScript
74 lines
1.5 KiB
JavaScript
import classNames from 'classnames';
|
|
import PropTypes from 'prop-types';
|
|
import React from 'react';
|
|
import Icon from 'Components/Icon';
|
|
import Link from 'Components/Link/Link';
|
|
import { icons } from 'Helpers/Props';
|
|
import styles from './FormInputHelpText.css';
|
|
|
|
function FormInputHelpText(props) {
|
|
const {
|
|
className,
|
|
text,
|
|
link,
|
|
tooltip,
|
|
isError,
|
|
isWarning,
|
|
isCheckInput
|
|
} = props;
|
|
|
|
return (
|
|
<div className={classNames(
|
|
className,
|
|
isError && styles.isError,
|
|
isWarning && styles.isWarning,
|
|
isCheckInput && styles.isCheckInput
|
|
)}
|
|
>
|
|
{text}
|
|
|
|
{
|
|
link ?
|
|
<Link
|
|
className={styles.link}
|
|
to={link}
|
|
title={tooltip}
|
|
>
|
|
<Icon
|
|
name={icons.EXTERNAL_LINK}
|
|
/>
|
|
</Link> :
|
|
null
|
|
}
|
|
|
|
{
|
|
!link && tooltip ?
|
|
<Icon
|
|
containerClassName={styles.details}
|
|
name={icons.INFO}
|
|
title={tooltip}
|
|
/> :
|
|
null
|
|
}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
FormInputHelpText.propTypes = {
|
|
className: PropTypes.string.isRequired,
|
|
text: PropTypes.string.isRequired,
|
|
link: PropTypes.string,
|
|
tooltip: PropTypes.string,
|
|
isError: PropTypes.bool,
|
|
isWarning: PropTypes.bool,
|
|
isCheckInput: PropTypes.bool
|
|
};
|
|
|
|
FormInputHelpText.defaultProps = {
|
|
className: styles.helpText,
|
|
isError: false,
|
|
isWarning: false,
|
|
isCheckInput: false
|
|
};
|
|
|
|
export default FormInputHelpText;
|