mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-03-20 17:04:06 -04:00
Display the link to application only if it's enabled Thanks to higa on discord for pointing this to us.
75 lines
1.5 KiB
JavaScript
75 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;
|