import{d as b,K as C,b as g,t as _,z as s,J as w,H as I}from"./registerWidgets.787b786f.js";import{b as h}from"./index.7b79e8ba.js";import"./gateway.db5ee0aa.js";import{C as i}from"./connector.693339a1.js";import{a as k}from"./asyncComputed.3103aa62.js";import{g as x,r as D}from"./icons.e9d866c3.js";import{C as E}from"./CrudView.e0b3c1f9.js";import"./passwordlessManager.42099b8c.js";import"./pubsub.dd86dbcf.js";import"./activeRecord.f8b90405.js";import"./DropdownMenu.d6704c7d.js";import"./Modal.9eb19c24.js";import"./LoadingIndicator.f28b4a2c.js";import"./lottie.221bef6b.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="51638313-b9e6-4479-9507-61f9f238b79a",o._sentryDebugIdIdentifier="sentry-dbid-51638313-b9e6-4479-9507-61f9f238b79a")}catch{}})();const Y=b({__name:"Connectors",setup(o){const n=w(),a=I(),c=n.params.projectId;async function l(e){const t=await i.create(c,e.name,e.type);a.push({name:"connectorEditor",params:{connectorId:t.id}})}const p=[{key:"name",label:"Connector name",type:"text"},{key:"type",label:"Connector type",type:Object.entries(h.schema).map(([e,t])=>({value:e,label:t.label}))}],{loading:d,result:m,refetch:u}=k(()=>i.list(c)),f=C(()=>{var e,t;return{columns:[{name:"Name"},{name:"Type"},{name:"actions"}],rows:(t=(e=m.value)==null?void 0:e.map(r=>({key:r.id,cells:[{text:r.name,classes:["centered"]},{text:r.type},{text:"Actions",classes:["centered"],actions:[{icon:x,label:"Edit",onClick({key:y}){a.push({name:"connectorEditor",params:{connectorId:y}})}},{icon:D,label:"Delete",dangerous:!0,async onClick(){await r.delete(),u()}}]}]})))!=null?t:[]}});return(e,t)=>(g(),_(E,{"entity-name":"connector",loading:s(d),title:"Connectors",description:"Each connector is a version of your app. You can create a new connector by deploying your app from the local editor.","empty-title":"No connectors here yet",table:s(f),fields:p,"create-button-text":"Create connector",onCreate:l},null,8,["loading","table"]))}});export{Y as default};
//# sourceMappingURL=Connectors.5842a39c.js.map
