@focuson/form_components
Version:
Components that can be used by @focuson/forms
12 lines (11 loc) • 628 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Label = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const pages_1 = require("@focuson/pages");
const utils_1 = require("@focuson/utils");
function Label({ state, label, htmlFor }) {
let string = (label === null || label === void 0 ? void 0 : label.includes('{')) ? (0, pages_1.replaceTextUsingPath)(state, (0, utils_1.safeString)(label)) : label;
return (0, jsx_runtime_1.jsx)("label", { htmlFor: htmlFor, className: "input-label", dangerouslySetInnerHTML: { __html: string ? string : '' } });
}
exports.Label = Label;