dynamic-modal
Version:
The dynamic-modal is a solution of creation different modals into project using a json configuration file
7 lines (6 loc) • 649 B
JavaScript
'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
const MakeDescription = ({ element: { text, Icon, containerStyle, textStyle, elements }, }) => {
return (_jsxs("div", { className: "flex gap-4 w-full h-auto text-xs text-center p-2 border-1 rounded-md", style: containerStyle, children: [Icon && _jsx(Icon, {}), text && !elements && _jsx("p", { style: textStyle, children: text }), !text && elements && (_jsx("p", { style: textStyle, children: elements.map((fragment) => (_jsx("span", { style: fragment.style, children: fragment.text }, `desc-fragment-${fragment.text}`))) }))] }));
};
export default MakeDescription;