@open-formulieren/formio-builder
Version:
An opinionated Formio webform builder for Open Forms
13 lines (12 loc) • 966 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { defineMessages, useIntl } from 'react-intl';
import { DateTimeField } from '../../../components/formio';
const FIXED_VALUE_MESSAGES = {
minDate: defineMessages({ label: { id: "TCNvqa", defaultMessage: [{ type: 0, value: "Minimum date" }] }, tooltip: { id: "lVEpR9", defaultMessage: [{ type: 0, value: "The minimum date that can be picked." }] } }),
maxDate: defineMessages({ label: { id: "7Uh91A", defaultMessage: [{ type: 0, value: "Maximum date" }] }, tooltip: { id: "Nsifca", defaultMessage: [{ type: 0, value: "The maximum date that can be picked." }] } }),
};
const FixedValueDateTimeField = ({ constraint }) => {
const intl = useIntl();
return (_jsx(DateTimeField, { name: `datePicker.${constraint}`, label: intl.formatMessage(FIXED_VALUE_MESSAGES[constraint].label), tooltip: intl.formatMessage(FIXED_VALUE_MESSAGES[constraint].tooltip) }));
};
export default FixedValueDateTimeField;