UNPKG

@open-tender/ui

Version:

A component library for use with the Open Tender web app

18 lines (17 loc) 1.42 kB
import { ArrowRight } from 'iconoir-react'; import React, { Children } from 'react'; import { makeProps } from '../utils'; import Button from './Button'; import Text from './Text'; import View from './View'; const AccountSection = ({ config, handlers, children, hasMore, title, subtitle }) => { const arrayChildren = Children.toArray(children); return (React.createElement(View, Object.assign({}, makeProps(config, 'accountSection')), React.createElement(View, Object.assign({}, makeProps(config, 'accountSection__header')), React.createElement(Text, Object.assign({}, makeProps(config, 'accountSection__title'), { text: title })), subtitle && (React.createElement(Text, Object.assign({}, makeProps(config, 'accountSection__subtitle'), { text: subtitle })))), React.createElement(View, Object.assign({}, makeProps(config, 'accountSection__content')), Children.map(arrayChildren, child => (React.createElement(View, Object.assign({}, makeProps(config, 'accountSection__item')), child)))), hasMore && (React.createElement(View, Object.assign({}, makeProps(config, 'accountSection__footer')), React.createElement(Button, Object.assign({}, makeProps(config, 'accountSection__button'), { onClick: handlers.view, icon: React.createElement(ArrowRight, { width: 18, height: 18, strokeWidth: 1.5 }), iconDisplay: "after" })))))); }; export default AccountSection;