'use client';
import React from 'react';
import { useFieldPath } from '../FieldPathProvider/index.js';
import { WatchCondition } from './WatchCondition.js';
export const withCondition = (Field)=>{
    const CheckForCondition = (props)=>{
        const { name } = props;
        const { path: pathFromContext } = useFieldPath();
        const path = pathFromContext || name;
        return /*#__PURE__*/ React.createElement(WatchCondition, {
            name: name,
            path: path
        }, /*#__PURE__*/ React.createElement(Field, props));
    };
    return CheckForCondition;
};

//# sourceMappingURL=index.js.map