import{__assign as t}from'./../../../ext-esm/tslib/tslib.es6.js';import{jsx as e,Fragment as r,jsxs as i}from"react/jsx-runtime";import{memo as o,useContext as n}from"react";import a from"react-draggable-list";import{makeStyles as l}from"@material-ui/core";import{Add as m}from"@material-ui/icons";import s from"../../IconButton/index.js";import d from"./RealTimeBox.js";import c from"../RealTimeSidebarContext.js";import{ORIENTATIONS as p}from"../enums.js";var u=l((function(){return{boxListVertical:{padding:"10px 0 16px",overflowX:"hidden"},rtBoxListHorizontal:{display:"flex",flexWrap:"wrap"},cTpRtBoxAddButtonContainer:{marginTop:8,textAlign:"center"}}}));var f=o((function(o){var l=o.sourceArray,f=o.findSource,x=u(),g=n(c),v=g.onAppSettingChange,y=g.appSettings,B=g.assetKey,b=g.orientation,h=g.realTimeTypes,T=g.setting,j=g.handleOpenCloseDialog;return e(r,{children:b===p.vertical?i("div",{className:x.boxListVertical,children:[e(a,{list:l,itemKey:function(t){return t.key},template:d,padding:0,unsetZIndex:!0,container:function(){return document.body},onMoveEnd:function(e){var r,i=e.map((function(t){return t.key}));v("rtValuesSetting",t(t({},y.rtValuesSetting),((r={})[B]=i,r)))}}),e("div",{className:x.cTpRtBoxAddButtonContainer,children:e(s,{"data-testid":"addRealTimeValuesButton",color:"primary",tooltipProps:{title:"Add"},onClick:j,children:e(m,{})})})]}):e("div",{className:x.rtBoxListHorizontal,children:T.map((function(t){return e(d,{isDraggable:!1,item:f(t,h)},"".concat(t))}))})})}));export{f as default};
