UNPKG

@open-tender/ui

Version:

A component library for use with the Open Tender web app

19 lines (18 loc) 1.45 kB
import React from 'react'; import { makeProps } from '../utils'; import Button from './Button'; import Text from './Text'; import View from './View'; const ModalContent = ({ config, title, subtitle, children, submit, submitText, cancel, cancelText, style }) => { const props = makeProps(config, 'modalContent', style); return (React.createElement(View, Object.assign({}, props), React.createElement(View, Object.assign({}, makeProps(config, 'modalContent__container')), React.createElement(View, Object.assign({}, makeProps(config, 'modalContent__header')), title && (React.createElement(Text, Object.assign({}, makeProps(config, 'modalContent__title'), { text: title }))), subtitle && (React.createElement(Text, Object.assign({}, makeProps(config, 'modalContent__subtitle'), { text: subtitle })))), React.createElement(View, Object.assign({}, makeProps(config, 'modalContent__content')), children), React.createElement(View, Object.assign({}, makeProps(config, 'modalContent__footer')), submit && (React.createElement(Button, Object.assign({}, makeProps(config, 'modalContent__primary'), { onClick: submit, text: submitText || 'Submit' }))), cancel && (React.createElement(Button, Object.assign({}, makeProps(config, 'modalContent__secondary'), { onClick: cancel, text: cancelText || 'Cancel' }))))))); }; export default ModalContent;