diff options
Diffstat (limited to 'plugins/jetpack/extensions/blocks/simple-payments/help-message.js')
-rw-r--r-- | plugins/jetpack/extensions/blocks/simple-payments/help-message.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/plugins/jetpack/extensions/blocks/simple-payments/help-message.js b/plugins/jetpack/extensions/blocks/simple-payments/help-message.js new file mode 100644 index 00000000..57a6e681 --- /dev/null +++ b/plugins/jetpack/extensions/blocks/simple-payments/help-message.js @@ -0,0 +1,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> + ) + ); +}; |