Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
31 lines
620 B
Plaintext
31 lines
620 B
Plaintext
'use client';
|
|
|
|
import { c as _c } from "react/compiler-runtime";
|
|
import { useFormFields } from '../Form/context.js';
|
|
export const WatchCondition = props => {
|
|
const $ = _c(2);
|
|
const {
|
|
children,
|
|
path
|
|
} = props;
|
|
let t0;
|
|
if ($[0] !== path) {
|
|
t0 = t1 => {
|
|
const [fields] = t1;
|
|
return fields && fields?.[path] || null;
|
|
};
|
|
$[0] = path;
|
|
$[1] = t0;
|
|
} else {
|
|
t0 = $[1];
|
|
}
|
|
const field = useFormFields(t0);
|
|
const {
|
|
passesCondition
|
|
} = field || {};
|
|
if (passesCondition === false) {
|
|
return null;
|
|
}
|
|
return children;
|
|
};
|
|
//# sourceMappingURL=WatchCondition.js.map |