import{j as e}from"./vendor-tanstack-BpuysabX.js";import{q as c,I as y,y as h,cL as k,a2 as x,a3 as g,a4 as j,a5 as m,a6 as C,a7 as D,br as p,cM as T}from"./index-CREafGO4.js";import{D as R,a as w,b as v,c as L,d as u}from"./dropdown-menu-DZExFL3b.js";const f=({id:n,onDelete:s,onReset:r})=>{const i=o=>{navigator.clipboard.writeText(o),h.success("ID copied")};return e.jsxs(R,{children:[e.jsx(w,{asChild:!0,children:e.jsxs(c,{variant:"outline",className:"size-8 p-0",children:[e.jsx("span",{className:"sr-only",children:"Open menu"}),e.jsx(y,{id:"MoreVertical",className:"size-4"})]})}),e.jsxs(v,{align:"end",children:[e.jsx(L,{children:"Actions"}),e.jsx(u,{onClick:()=>i(n),children:"Copy ID"}),e.jsx(u,{variant:"destructive",onClick:s,children:"Delete"}),e.jsx(u,{onClick:r,children:"Reset"})]})]})},S=({data:n,onOpenChange:s,onDelete:r})=>{const{deleteTaskRunConcurrencyLimit:i,isPending:o}=k(),t=a=>{i(a,{onSuccess:()=>{h.success("Concurrency limit deleted")},onError:l=>{const d=l.message||"Unknown error while deleting concurrency limit.";console.error(d)},onSettled:r})};return e.jsx(x,{open:!0,onOpenChange:s,children:e.jsxs(g,{children:[e.jsx(j,{children:e.jsx(m,{children:"Delete Concurrency Limit"})}),e.jsxs(C,{children:["Are you sure you want to delete ",n.tag]}),e.jsxs(D,{children:[e.jsx(p,{asChild:!0,children:e.jsx(c,{variant:"outline",children:"Close"})}),e.jsx(c,{variant:"destructive",onClick:()=>t(n.id),loading:o,children:"Delete"})]})]})})},A=({data:n,onOpenChange:s,onReset:r})=>{const{resetTaskRunConcurrencyLimitTag:i,isPending:o}=T(),t=a=>{i(a,{onSuccess:()=>{h.success("Concurrency limit reset")},onError:l=>{const d=l.message||"Unknown error while resetting concurrency limit.";console.error(d)},onSettled:r})};return e.jsx(x,{open:!0,onOpenChange:s,children:e.jsxs(g,{children:[e.jsx(j,{children:e.jsxs(m,{children:["Reset concurrency limit for tag ",n.tag]})}),e.jsx(C,{children:"This will reset the active task run count to 0."}),e.jsxs(D,{children:[e.jsx(p,{asChild:!0,children:e.jsx(c,{variant:"outline",children:"Close"})}),e.jsx(c,{onClick:()=>t(n.tag),loading:o,children:"Reset"})]})]})})};export{f as T,S as a,A as b};
//# sourceMappingURL=task-run-concurrency-limits-reset-dialog-CD37i-PX.js.map
