import{j as r}from"./cm-1.0.63-CSIRHMXC.js";import{r as m}from"./redux-1.0.63-Df-eBzJn.js";import{B as s}from"./Spinner-1.0.63-zcgIyS7Z.js";import"./vendor-1.0.63-CN03Eozo.js";import"./lib-1.0.63-DJZPtMem.js";import"./loglevel-1.0.63-BZ7XahX3.js";import"./lodash-1.0.63-hMxolcpJ.js";import"./moment-1.0.63-C5S46NFB.js";import"./Typography-1.0.63-mecuj_Wl.js";const C=m.memo(({queryResults:t})=>{var d,b,p,i,n,c,h;const f=(a,o,e)=>{const x=o[e]===null?"pp-data-value-null":"";return r.jsx("td",{className:x,children:o[e]},a+e)};let l=((d=t==null?void 0:t.columns)==null?void 0:d.map(a=>a.Field))??null;return l===null&&Array.isArray((b=t==null?void 0:t.status)==null?void 0:b.last_result)&&((p=t==null?void 0:t.status)==null?void 0:p.last_result.length)>0&&(l=Object.keys((i=t==null?void 0:t.status)==null?void 0:i.last_result[0])),r.jsx(s,{sx:{borderTopLeftRadius:"4px",borderTopRightRadius:"4px",backgroundColor:"#fff","& table.pp-sql-query-builder-table":{width:"100%",marginBottom:"0 !important",border:"none",borderCollapse:"collapse",borderTopLeftRadius:"4px",borderTopRightRadius:"4px",borderBottomLeftRadius:0,borderBottomRightRadius:0},"& table.pp-sql-query-builder-table thead":{display:"block",overflowY:"scroll",backgroundColor:"#f0f0f1",borderTopLeftRadius:"4px",borderTopRightRadius:"4px",borderBottomLeftRadius:0,borderBottomRightRadius:0},"& table.pp-sql-query-builder-table thead::-webkit-scrollbar":{borderTopRightRadius:"4px"},"& table.pp-sql-query-builder-table tbody":{display:"block",overflowY:"scroll",height:"240px",borderTop:"1px solid #ccc",backgroundColor:"#fff"},"& table.pp-sql-query-builder-table tr":{width:"calc(100% - 1px)",display:"table",tableLayout:"fixed"},"& table.pp-sql-query-builder-table tbody tr:hover":{backgroundColor:"#f5f5f5"},"& table.pp-sql-query-builder-table thead tr th":{borderRight:"1px dotted #ccc",height:"17px",lineHeight:"17px"},"& table.pp-sql-query-builder-table tbody tr td":{borderRight:"1px dotted #ccc",borderBottom:"1px dotted #ccc",borderLeft:0},"& table.pp-sql-query-builder-table tbody tr:first-of-type td":{borderTop:0},"& table.pp-sql-query-builder-table thead tr th, & table.pp-sql-query-builder-table tbody tr td":{overflowWrap:"anywhere",textAlign:"left",padding:"6px"},"& table.pp-sql-query-builder-table tbody td.pp-data-value-null":{fontStyle:"italic",color:"#2271b1"},"& table.pp-sql-query-builder-table tbody td.pp-data-value-null:before":{content:'"(null)"'}},children:Array.isArray((n=t==null?void 0:t.status)==null?void 0:n.last_result)&&r.jsxs("table",{className:"pp-sql-query-builder-table",children:[r.jsx("thead",{children:r.jsx("tr",{children:Array.isArray(l)&&l.length>0?r.jsx(r.Fragment,{children:l.map(a=>r.jsx("th",{children:a},a))}):r.jsx("th",{})},"header")}),r.jsx("tbody",{children:(h=(c=t==null?void 0:t.status)==null?void 0:c.last_result)==null?void 0:h.map((a,o)=>r.jsx("tr",{children:Object.keys(a).map(e=>f(o,a,e))},o))})]})})});export{C as default};
