@enonic/react-components
Version:
Library of React components for handling Enonic XP data and page components
2 lines (1 loc) • 1.01 kB
JavaScript
import{a as r,b as t,c as i,k as c}from"./chunk-PN3WU6U5.mjs";import{jsx as E}from"react/jsx-runtime";var f="#e0b4b4",R="#9f3a38",l=t(r({},c),{borderColor:f,color:R});function m(d){var n=d,{children:o,html:e}=n,s=i(n,["children","html"]);return e?E("div",t(r({},s),{dangerouslySetInnerHTML:{__html:e},style:l})):E("div",t(r({},s),{style:l,children:o}))}import{jsx as M}from"react/jsx-runtime";var a=d=>{var n=d,{children:o,mode:e}=n,s=i(n,["children","mode"]);return e==="live"||e==="preview"?(console.error(o),null):e==="inline"||e==="edit"||e==="admin"?M(m,t(r({},s),{children:o})):(e?console.error(`Unsupported mode passed to Message component! mode:${e} children:${o}`):console.warn(`Message component didn't get mode prop! children:${o}`),null)};import{jsx as p,jsxs as g}from"react/jsx-runtime";function C(o){return({error:e})=>g(a,{mode:o,children:[p("h2",{children:"Error rendering component"}),p("p",{children:e.message}),o==="edit"&&e.stack&&p("pre",{children:e.stack})]})}export{m as a,a as b,C as c};