UNPKG

@open-tender/ui

Version:

A component library for use with the Open Tender web app

12 lines (11 loc) 566 B
import React from 'react'; import { makeProps } from '../utils'; import Text from './Text'; import View from './View'; const ErrorMessage = ({ config, children, icon, style }) => { const props = makeProps(config, 'errorMessage__message', style); return (React.createElement(View, Object.assign({}, makeProps(config, 'errorMessage')), icon && React.createElement(View, Object.assign({}, makeProps(config, 'errorMessage__icon')), icon), React.createElement(Text, Object.assign({}, props, { text: children })))); }; export default ErrorMessage;