Files
klz-cables.com/.pnpm-store/v10/files/c5/87d9b3381fa349a4984234bc5ee04f222b1c40e611f222d2bd6b103932e8433dcd714a6f85e961f943b51cc49aa601eb56c423813c8afb0ed46df35932b534
Marc Mintel 5397309103
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
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

67 lines
1.8 KiB
Plaintext

'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx } from "react/jsx-runtime";
import React from 'react';
import { Tooltip } from '../../elements/Tooltip/index.js';
import { useFormFields, useFormSubmitted } from '../../forms/Form/context.js';
import './index.scss';
const baseClass = 'field-error';
export const FieldError = props => {
const $ = _c(8);
const {
alignCaret: t0,
message: messageFromProps,
path,
showError: showErrorFromProps
} = props;
const alignCaret = t0 === undefined ? "right" : t0;
const hasSubmitted = useFormSubmitted();
let t1;
if ($[0] !== path) {
t1 = t2 => {
const [fields] = t2;
return fields && fields?.[path] || null;
};
$[0] = path;
$[1] = t1;
} else {
t1 = $[1];
}
const field = useFormFields(t1);
let t2;
if ($[2] !== alignCaret || $[3] !== field || $[4] !== hasSubmitted || $[5] !== messageFromProps || $[6] !== showErrorFromProps) {
t2 = Symbol.for("react.early_return_sentinel");
bb0: {
const {
errorMessage,
valid
} = field || {};
const message = messageFromProps || errorMessage;
const showMessage = showErrorFromProps || hasSubmitted && valid === false;
if (showMessage && message?.length) {
t2 = _jsx(Tooltip, {
alignCaret,
className: baseClass,
delay: 0,
staticPositioning: true,
children: message
});
break bb0;
}
}
$[2] = alignCaret;
$[3] = field;
$[4] = hasSubmitted;
$[5] = messageFromProps;
$[6] = showErrorFromProps;
$[7] = t2;
} else {
t2 = $[7];
}
if (t2 !== Symbol.for("react.early_return_sentinel")) {
return t2;
}
return null;
};
//# sourceMappingURL=index.js.map