2019-06-25 09:43:49 -04:00
|
|
|
const classNames = require('classnames');
|
|
|
|
const PropTypes = require('prop-types');
|
|
|
|
const React = require('react');
|
|
|
|
|
|
|
|
require('./validation-message.scss');
|
|
|
|
|
|
|
|
const ValidationMessage = props => (
|
2019-08-12 17:52:16 -04:00
|
|
|
<div
|
|
|
|
className={classNames(
|
|
|
|
'validation-message',
|
|
|
|
{
|
2019-08-16 17:58:10 -04:00
|
|
|
'validation-error': props.mode === 'error',
|
|
|
|
'validation-info': props.mode === 'info'
|
2019-08-12 17:52:16 -04:00
|
|
|
},
|
|
|
|
props.className
|
|
|
|
)}
|
|
|
|
>
|
2019-06-25 09:43:49 -04:00
|
|
|
{props.message}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
|
|
|
ValidationMessage.propTypes = {
|
|
|
|
className: PropTypes.string,
|
2019-08-16 17:58:10 -04:00
|
|
|
message: PropTypes.string,
|
2021-05-13 10:36:40 -04:00
|
|
|
mode: PropTypes.oneOfType([PropTypes.string, PropTypes.node])
|
2019-06-25 09:43:49 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = ValidationMessage;
|