UNPKG

@open-formulieren/formio-builder

Version:

An opinionated Formio webform builder for Open Forms

31 lines (30 loc) 1.25 kB
import { jsx as _jsx } from "react/jsx-runtime"; import { useIntl } from 'react-intl'; import { SelectBoxes } from '../../components/formio'; /** * Show a formio npFamilyMembers 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 = {}, includeChildren, includePartners, } = component; const { required = false } = validate; const options = []; if (includePartners) { options.push({ value: 'partner1', label: intl.formatMessage({ id: "loKqis", defaultMessage: [{ type: 0, value: "Partner 1" }] }), }); } if (includeChildren) { options.push({ value: 'child1', label: intl.formatMessage({ id: "I7lkuw", defaultMessage: [{ type: 0, value: "Child 1" }] }), }); } return (_jsx(SelectBoxes, { name: key, options: options, label: label, tooltip: tooltip, required: required, description: description })); }; export default Preview;