summaryrefslogtreecommitdiff
blob: 57a6e6819ebb162725546a02934a492e51400ba7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
 * External dependencies
 */
import classNames from 'classnames';

/**
 * Internal dependencies
 */
import GridiconNoticeOutline from 'gridicons/dist/notice-outline';
import './help-message.scss';

export default ( { children = null, isError = false, ...props } ) => {
	const classes = classNames( 'simple-payments__help-message', {
		'simple-payments__help-message-is-error': isError,
	} );

	return (
		children && (
			<div className={ classes } { ...props }>
				{ isError && <GridiconNoticeOutline size="24" /> }
				<span>{ children }</span>
			</div>
		)
	);
};