@open-formulieren/formio-builder
Version:
An opinionated Formio webform builder for Open Forms
12 lines (11 loc) • 684 B
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import clsx from 'clsx';
import { useValidationErrors } from '../../utils/errors';
import { ErrorList } from '../../utils/errors';
import Tooltip from './tooltip';
const Fieldset = ({ field = '', label, tooltip = '', children }) => {
const { errors } = useValidationErrors(field);
const className = clsx('field-group');
return (_jsx("div", Object.assign({ className: className }, { children: _jsxs("fieldset", { children: [label && (_jsxs("legend", { children: [label, tooltip && ' ', _jsx(Tooltip, { text: tooltip })] })), children, _jsx(ErrorList, { errors: errors })] }) })));
};
export default Fieldset;