dynamic-modal
Version:
The dynamic-modal is a solution of creation different modals into project using a json configuration file
9 lines (8 loc) • 806 B
JavaScript
'use client';
;
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
const MakeDescription = ({ element: { text, Icon, containerStyle, textStyle, elements }, }) => {
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex gap-4 w-full h-auto text-xs text-center p-2 border-1 rounded-md", style: containerStyle, children: [Icon && (0, jsx_runtime_1.jsx)(Icon, {}), text && !elements && (0, jsx_runtime_1.jsx)("p", { style: textStyle, children: text }), !text && elements && ((0, jsx_runtime_1.jsx)("p", { style: textStyle, children: elements.map((fragment, index) => ((0, jsx_runtime_1.jsx)("span", { style: fragment.style, children: fragment.text }, `desc-fragment-${index}`))) }))] }));
};
exports.default = MakeDescription;