import{j as r}from"./tanstack-1.0.74-aU0azVkW.js";import{r as x}from"./redux-1.0.74-D8bIc6ki.js";import{B as m}from"./Box-1.0.74-DEbuVvGV.js";import"./vendor-1.0.74-CN03Eozo.js";import"./CircularProgress-1.0.74-QfwfRJ7i.js";import"./lib-1.0.74-B5IEqfHg.js";import"./utils-1.0.74-7xWhx9mc.js";import"./Typography-1.0.74-B4mhsevh.js";const A=x.memo(({queryResults:t})=>{var d,b,p,i,n,c,h;const s=(a,e,o)=>{const f=e[o]===null?"pp-data-value-null":"";return r.jsx("td",{className:f,children:e[o]},a+o)};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(m,{className:"pp-result-table-container",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,e)=>r.jsx("tr",{children:Object.keys(a).map(o=>s(e,a,o))},e))})]})})});export{A as default};
