@devgateway/dvz-ui-react
Version:
A modular, embeddable React component library for data visualization and UI, built with TypeScript. Provides reusable components for charts, maps, dashboards, and more, with built-in support for internationalization and Redux integration.
2 lines (1 loc) • 1.04 kB
JavaScript
;const e=require("react/jsx-runtime"),a=require("semantic-ui-react"),d=require("@devgateway/wp-react-lib"),x=require("react-intl"),g=({pages:r,columns:s})=>{const t=r?r.sort((c,i)=>c.menu_order-i.menu_order):[],o=t.length/parseInt(s)+(t.length%parseInt(s)>0?1:0);let n=-1;return e.jsx("div",{children:e.jsx(a.Grid,{columns:s,children:[...Array(parseInt(o)).keys()].map((c,i)=>e.jsx(a.Grid.Row,{children:[...Array(parseInt(s)).keys()].map((l,h)=>(n++,e.jsx(a.Grid.Column,{children:e.jsx(d.PostIntro,{as:"div",post:t[n]})},l)))},i))})})},j=r=>{const{"data-height":s,"data-style":t,"data-columns":o,"data-parent":n,editing:c,component:i,unique:l,intl:{locale:h}}=r,u={style:t,columns:o};return e.jsxs(a.Container,{fluid:!0,className:`viz dashboard gallery ${t}`,children:[n&&e.jsx(d.PageProvider,{locale:h,parent:n,store:"gallery_"+r.parent+"_"+r.unique,perPage:100,children:e.jsx(d.PageConsumer,{children:e.jsx(g,{...u})})}),!n&&e.jsx(a.Segment,{color:"red",children:"No child pages here"})]})},p=x.injectIntl(j);module.exports=p;