UNPKG

@open-tender/ui

Version:

A component library for use with the Open Tender web app

12 lines (11 loc) 650 B
import React from 'react'; import { makeProps } from '../utils'; import Button from './Button'; import View from './View'; const ItemSize = ({ config, handlers, sizeGroup, appliedId }) => { return (React.createElement(View, Object.assign({}, makeProps(config, 'itemSize')), sizeGroup.options.map(option => { const disabled = option.id === appliedId; return (React.createElement(Button, Object.assign({}, makeProps(config, disabled ? 'itemSize__buttonSelected' : 'itemSize__button'), { key: option.id, onClick: () => handlers.toggleSize(option.id), disabled: disabled, text: option.name }))); }))); }; export default ItemSize;