Files
klz-cables.com/.pnpm-store/v10/files/a7/3de659561bffd60b8b05211274b5d049970b37ca9dee0497f4c85bf5183a9fa47c54990ade37f426e9c29d82064ad1cc28346fa7c23f99f83cb2d777b2e7d0
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

56 lines
1.8 KiB
Plaintext

'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { getTranslation } from '@payloadcms/translations';
import React from 'react';
import { useForm } from '../../forms/Form/context.js';
import { useEditDepth } from '../../providers/EditDepth/index.js';
import { useLocale } from '../../providers/Locale/index.js';
import { useTranslation } from '../../providers/Translation/index.js';
import { generateFieldID } from '../../utilities/generateFieldID.js';
import './index.scss';
export const FieldLabel = props => {
const {
as: t0,
hideLocale: t1,
htmlFor: htmlForFromProps,
label,
localized: t2,
path,
required: t3,
unstyled: t4
} = props;
const ElementFromProps = t0 === undefined ? "label" : t0;
const hideLocale = t1 === undefined ? false : t1;
const localized = t2 === undefined ? false : t2;
const required = t3 === undefined ? false : t3;
const unstyled = t4 === undefined ? false : t4;
const {
uuid
} = useForm();
const editDepth = useEditDepth();
const htmlFor = htmlForFromProps || generateFieldID(path, editDepth, uuid);
const {
i18n
} = useTranslation();
const {
code,
label: localLabel
} = useLocale();
const Element = ElementFromProps === "label" ? htmlFor ? "label" : "span" : ElementFromProps || "span";
if (label) {
return _jsxs(Element, {
className: `field-label${unstyled ? " unstyled" : ""}`,
htmlFor,
children: [getTranslation(label, i18n), required && !unstyled && _jsx("span", {
className: "required",
children: "*"
}), localized && !hideLocale && _jsxs("span", {
className: "localized",
children: ["\u2014 ", typeof localLabel === "string" ? localLabel : code]
})]
});
}
return null;
};
//# sourceMappingURL=index.js.map