import{j as e}from"./vendor-tanstack-BVzzyDEt.js";import{r as y,s as k,q as c,I as T,t as w,u as R,v as u,w as h,cV as v,ae as g,af as x,ag as j,ah as m,ai as C,aq as D,bf as p,cW as L}from"./index-BJkJ93Lr.js";const f=({id:n,onDelete:s,onReset:r})=>{const i=o=>{navigator.clipboard.writeText(o),h.success("ID copied")};return e.jsxs(y,{children:[e.jsx(k,{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(T,{id:"MoreVertical",className:"size-4"})]})}),e.jsxs(w,{align:"end",children:[e.jsx(R,{children:"Actions"}),e.jsx(u,{onClick:()=>i(n),children:"Copy ID"}),e.jsx(u,{onClick:s,children:"Delete"}),e.jsx(u,{onClick:r,children:"Reset"})]})]})},b=({data:n,onOpenChange:s,onDelete:r})=>{const{deleteTaskRunConcurrencyLimit:i,isPending:o}=v(),t=l=>{i(l,{onSuccess:()=>{h.success("Concurrency limit deleted")},onError:a=>{const d=a.message||"Unknown error while deleting concurrency limit.";console.error(d)},onSettled:r})};return e.jsx(g,{open:!0,onOpenChange:s,children:e.jsxs(x,{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"})]})]})})},S=({data:n,onOpenChange:s,onReset:r})=>{const{resetTaskRunConcurrencyLimitTag:i,isPending:o}=L(),t=l=>{i(l,{onSuccess:()=>{h.success("Concurrency limit reset")},onError:a=>{const d=a.message||"Unknown error while resetting concurrency limit.";console.error(d)},onSettled:r})};return e.jsx(g,{open:!0,onOpenChange:s,children:e.jsxs(x,{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,b as a,S as b};
//# sourceMappingURL=task-run-concurrency-limits-reset-dialog--42fkldX.js.map
