isValid: boolean;
label?: React.ReactNode;
required?: boolean;
+ showValidIcon?: boolean;
}
export enum ValidationInputErrorPlacement {
isValid,
label,
required,
+ showValidIcon = true,
} = props;
+
const hasError = isInvalid && error !== undefined;
let childrenWithStatus: React.ReactNode;
+
if (errorPlacement === ValidationInputErrorPlacement.Right) {
childrenWithStatus = (
<>
{children}
- {isValid && (
+ {showValidIcon && isValid && (
<AlertSuccessIcon
ariaLabel={translate('valid_input')}
className="spacer-left text-middle"
childrenWithStatus = (
<>
{children}
- {isValid && (
+ {showValidIcon && isValid && (
<AlertSuccessIcon
ariaLabel={translate('valid_input')}
className="spacer-left text-middle"
/>
)}
- <div className="spacer-top">
+ <div className="spacer-top" style={{ display: 'flex' }}>
{isInvalid && <AlertErrorIcon className="text-middle" />}
{hasError && <span className="little-spacer-left text-danger text-middle">{error}</span>}
</div>