UNPKG

@open-tender/ui

Version:

A component library for use with the Open Tender web app

13 lines (12 loc) 727 B
import { formatQuantity } from '@open-tender/utils'; import React from 'react'; import { makeProps } from '../utils'; import Text from './Text'; import View from './View'; const NutritionalInfoLine = ({ config, label, value, unit, isLast }) => { const val = `${formatQuantity(value.toString())}${unit}`; return (React.createElement(View, Object.assign({}, makeProps(config, isLast ? 'nutritionalInfo__lineLast' : 'nutritionalInfo__line')), React.createElement(Text, Object.assign({}, makeProps(config, 'nutritionalInfo__lineLabel'), { text: label })), React.createElement(Text, Object.assign({}, makeProps(config, 'nutritionalInfo__lineValue'), { text: val })))); }; export default NutritionalInfoLine;