import{d as f,eA as k,G as y,b,c as g,u as h}from"./outputWidgets.04a14374.js";import{e as _,d as w}from"./icons.dee9dbe8.js";import{a as H}from"./asyncComputed.53598080.js";import{H as c}from"./hooks.c5421590.js";import{C}from"./CrudView.a6f509b7.js";import{a as x}from"./ant-design.213d3e09.js";import"./record.b64a41e6.js";import"./pubsub.bb759777.js";import"./Text.84d5ffc7.js";import"./Base.0c1843db.js";import"./transButton.772cc0ed.js";import"./router.4677d467.js";import"./Title.9beb186f.js";import"./index.5d9ba614.js";import"./url.311573c2.js";import"./index.9bdc1e6b.js";import"./index.90d3343e.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},r=new Error().stack;r&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[r]="c7792953-6eac-4b12-bf94-a125426ab3e2",a._sentryDebugIdIdentifier="sentry-dbid-c7792953-6eac-4b12-bf94-a125426ab3e2")}catch{}})();const $=f({__name:"Hooks",setup(a){const r=k(),{loading:i,result:n,refetch:d}=H(()=>c.list()),s=({key:e})=>r.push({name:"hookEditor",params:{id:e}}),l=async()=>{const e=await c.create();s({key:e.id})},m=async({key:e})=>{var o,t;await x("Are you sure you want to delete this hook?")&&(await((t=(o=n.value)==null?void 0:o.find(u=>u.id===e))==null?void 0:t.delete()),d())},p=y(()=>{var e,o;return{columns:[{name:"Hook Name"},{name:"Path"},{name:"Actions",align:"right"}],rows:(o=(e=n.value)==null?void 0:e.map(t=>({key:t.id,cells:[{text:t.title,link:`/_editor/hook/${encodeURIComponent(t.id)}`},{text:t.path},{text:"",actions:[{icon:_,label:"Edit Hook",onClick:s},{icon:w,label:"Delete",onClick:m,dangerous:!0}]}]})))!=null?o:[]}});return(e,o)=>(b(),g(C,{loading:h(i),title:"Hooks",description:"Trigger your Python scripts with a request.","create-button-text":"Create Hook","empty-title":"No hooks here yet",table:p.value,"entity-name":"Hook",onCreate:l},null,8,["loading","table"]))}});export{$ as default};
//# sourceMappingURL=Hooks.5a2e0b83.js.map
