@try-at-software/input-elements
Version:
A package providing different input elements that are extensible and easily configurable for your custom needs.
20 lines (19 loc) • 765 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.materializeErrorMessage = exports.FormTextRenderer = void 0;
const React = require("react");
const FormTextRendererComponent = (props) => {
const { text: TextValue } = props;
if (!TextValue)
return null;
if (typeof TextValue === 'string')
return React.createElement(React.Fragment, null, TextValue);
return React.createElement(TextValue, null);
};
exports.FormTextRenderer = React.memo(FormTextRendererComponent);
function materializeErrorMessage(error) {
if (!error)
return null;
return React.createElement(exports.FormTextRenderer, { text: error });
}
exports.materializeErrorMessage = materializeErrorMessage;