import{e,ar as o,as as j,at as x,aO as f,av as n,aw as t,a9 as c,au as g,aN as d,S as u,T,P as i}from"./index-_6SmYgWK.js";const y=({columns:b,rows:h,sx:p})=>{const m=(s,a)=>{if(a[s]===null||a[s]===void 0)return"";if(s==="enabled")return a[s]?e.jsx(d,{label:"Enabled",color:"primary"}):e.jsx(d,{label:"Disabled"});if(s==="type"&&a.schema){let l;return Array.isArray(a.schema)?l="[<br>"+a.schema.map(r=>`&nbsp;&nbsp;${JSON.stringify({[r.name]:r.type},null,2)}`).join(",<br>")+"<br>]":typeof a.schema=="object"&&a.schema!==null?l=JSON.stringify(a.schema,null,2).replace(/\n/g,"<br>").replace(/ /g,"&nbsp;"):l="No schema available",e.jsxs(u,{direction:"row",alignItems:"center",spacing:1,children:[e.jsx(T,{children:a[s]}),e.jsx(c,{title:`<div>Schema:<br/>${l}</div>`})]})}else return typeof a[s]=="object"?JSON.stringify(a[s]):a[s]};return e.jsx(e.Fragment,{children:e.jsx(o,{component:j,children:e.jsxs(x,{sx:{minWidth:650,...p},"aria-label":"simple table",children:[e.jsx(f,{children:e.jsx(n,{children:b.map((s,a)=>e.jsx(t,{children:s==="enabled"?e.jsxs(e.Fragment,{children:["Override",e.jsx(c,{style:{mb:1,mt:2,marginLeft:10},title:"If enabled, this variable can be overridden in API calls and embeds. If disabled, any overrides will be ignored. To change this, go to Security settings in Chatflow Configuration."})]}):s.charAt(0).toUpperCase()+s.slice(1)},a))})}),e.jsx(g,{children:h.map((s,a)=>e.jsx(n,{sx:{"&:last-child td, &:last-child th":{border:0}},children:Object.keys(s).map((l,r)=>{if(l!=="id"&&l!=="schema")return e.jsx(t,{children:m(l,s)},r)})},a))})]})})})};y.propTypes={rows:i.array,columns:i.array,sx:i.object};export{y as T};
