"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.renderOrCreateElement = void 0;
const react_1 = require("react");
const renderOrCreateElement = (element, props = undefined) => {
    if (element) {
        if (typeof element === 'string') {
            if (props) {
                return (0, react_1.createElement)('span', props, element);
            }
            return element;
        }
        if (typeof element === 'function') {
            return (0, react_1.createElement)(element, props);
        }
        else if (props) {
            return (0, react_1.cloneElement)(element, props);
        }
        return element;
    }
    return null;
};
exports.renderOrCreateElement = renderOrCreateElement;
//# sourceMappingURL=renderOrCreateElement.js.map