import{d as f,eA as k,G as y,b,c as g,u as h}from"./outputWidgets.e822ff0f.js";import{e as _,d as w}from"./icons.0ab0d55f.js";import{a as H}from"./asyncComputed.68870ff7.js";import{H as c}from"./hooks.6566dca4.js";import{C}from"./CrudView.0a0ee0a6.js";import{a as x}from"./ant-design.e2b10503.js";import"./record.edca104e.js";import"./pubsub.ae710ef5.js";import"./Text.4c9d53a2.js";import"./Base.775de4d5.js";import"./transButton.f06af665.js";import"./router.8fbd98d9.js";import"./Title.5afb3003.js";import"./index.bf8163eb.js";import"./url.c786ab78.js";import"./index.eb9667df.js";import"./index.1b95bbbc.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]="c86ca9e1-3b4f-4510-835a-4406950c035e",a._sentryDebugIdIdentifier="sentry-dbid-c86ca9e1-3b4f-4510-835a-4406950c035e")}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.8a98ceef.js.map
