'use client';
import React from 'react';
import { Fragment } from 'react';
import { useFormFields } from '../Form/context.js';
export const WatchCondition = (props)=>{
    const { name, children, path: pathFromProps } = props;
    const path = typeof pathFromProps === 'string' ? pathFromProps : name;
    const field = useFormFields(([fields])=>fields && fields?.[path] || null);
    const { passesCondition } = field || {};
    if (passesCondition === false) {
        return null;
    }
    return /*#__PURE__*/ React.createElement(Fragment, null, children);
};

//# sourceMappingURL=WatchCondition.js.map