import{r as s,d as p,F as g,j as l}from"./react.6693569e.js";import{a as e}from"./index.ab3d776b.js";/* empty css               */import{B as i}from"./antd.e57bc55d.js";const k="_task_19hw7_1",v="_buttonGroup_19hw7_6",n={task:k,buttonGroup:v},b=({params:o,onMethod:a})=>{const{status:y,approvalId:t}=o,m=s.exports.useCallback(()=>{a==null||a("closeWindow",[null,{cancelled:!0}])},[]),[f,r]=s.exports.useState(!1),A=s.exports.useCallback(async()=>{try{r(!0);const u={status:1};await e.groupApi.patchApprovalStatus(t,u),a==null||a("closeWindow",[null,u])}catch(u){a==null||a("closeWindow",[u])}finally{r(!1)}},[a,t]);return s.exports.useEffect(()=>{!t||e.groupApi.getApproval(t).then(u=>{const c={join_group:"\u5165\u7EC4\u5BA1\u6279",create_group:"\u5EFA\u7EC4\u5BA1\u6279"};c[u==null?void 0:u.type]&&a("setTitle",[c[u==null?void 0:u.type]])})},[t]),p(g,{children:[l("div",{className:n.task,children:"\u60A8\u5C06\u5BA1\u6279\u901A\u8FC7\u8BE5\u7533\u8BF7"}),p("div",{className:n.buttonGroup,children:[l(i,{onClick:m,children:"\u53D6\u6D88"}),l(i,{type:"primary",loading:f,onClick:A,children:"\u786E\u8BA4"})]})]})};export{b as default};
