(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2253],{18720:(e,r,t)=>{Promise.resolve().then(t.bind(t,70482)),Promise.resolve().then(t.t.bind(t,63363,23))},64678:(e,r,t)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var o={callServer:function(){return s.callServer},createServerReference:function(){return c.createServerReference},findSourceMapURL:function(){return a.findSourceMapURL}};for(var n in o)Object.defineProperty(r,n,{enumerable:!0,get:o[n]});let s=t(22673),a=t(43145),c=t(87478)},70482:(e,r,t)=>{"use strict";t.d(r,{default:()=>i});var o=t(3680),n=t(78604),s=t(39504),a=t(64678);let c=(0,a.createServerReference)("4032f1b03a0390b34d31a8ba47bbfdb6df1552202c",a.callServer,void 0,a.findSourceMapURL,"resolveApprovalAction");function i({approvalId:e}){let[r,t]=(0,n.useTransition)(),[a,l]=(0,n.useState)(!1),[d,u]=(0,n.useState)("");return(0,o.jsxs)("div",{className:"space-y-2",children:[(0,o.jsxs)("div",{className:"flex gap-2",children:[(0,o.jsx)("button",{type:"button",onClick:function(){t(async()=>{let r=await c({approvalRequestId:e,decision:"approve"});r.ok?s.oR.success("Approved"):s.oR.error(r.message)})},disabled:r,className:"rounded-md bg-ok px-3 py-1.5 text-xs font-semibold text-canvas transition-[filter] hover:brightness-[0.92] disabled:opacity-40",children:"Approve"}),(0,o.jsx)("button",{type:"button",onClick:function(){a?t(async()=>{let r=await c({approvalRequestId:e,decision:"reject",notes:d.trim()||void 0});r.ok?(s.oR.success("Rejected"),l(!1),u("")):s.oR.error(r.message)}):l(!0)},disabled:r,className:"rounded-md border border-err/30 px-3 py-1.5 text-xs font-semibold text-err transition-colors hover:border-err/60 disabled:opacity-40",children:a?"Confirm reject":"Reject"}),a&&(0,o.jsx)("button",{type:"button",onClick:()=>{l(!1),u("")},className:"px-3 py-1.5 text-xs text-ink-3 hover:text-ink",children:"Cancel"})]}),a&&(0,o.jsx)("textarea",{value:d,onChange:e=>u(e.target.value),placeholder:"Reason for rejection (optional, shown to the agent)",rows:2,maxLength:500,className:"w-full resize-none rounded-md border border-rule bg-canvas px-2 py-1.5 text-xs text-ink placeholder-ink-4 focus:border-ink-3 focus:outline-none"})]})}}},e=>{e.O(0,[3363,9504,1065,8724,7358],()=>e(e.s=18720)),_N_E=e.O()}]);