UNPKG

@open-formulieren/formio-builder

Version:

An opinionated Formio webform builder for Open Forms

28 lines (27 loc) 1.14 kB
import { jsx as _jsx } from "react/jsx-runtime"; import { useIntl } from 'react-intl'; import { Radio } from '../../components/formio'; /** * Show a formio productPrice component preview. * * NOTE: for the time being, this is rendered in the default Formio bootstrap style, * however at some point this should use the components of * @open-formulieren/formio-renderer instead for a more accurate preview. */ const Preview = ({ component }) => { const intl = useIntl(); const { key, label, description, tooltip, validate = {} } = component; const { required = false } = validate; const options = [ { value: 'option 1', label: intl.formatMessage({ id: "sxdJ/8", defaultMessage: [{ type: 0, value: "option 1: \u20AC 10,99" }] }), }, { value: 'option 2', label: intl.formatMessage({ id: "jtWzSW", defaultMessage: [{ type: 0, value: "option 2: \u20AC 15,99" }] }), }, ]; return (_jsx(Radio, { name: key, options: options, label: label, tooltip: tooltip, required: required, description: description })); }; export default Preview;