import{r as n,a as p}from"./app-BwDemWQz.js";import{s as u}from"./index-CkDmAPFS.js";const c=(g,r)=>{const[l,o]=n.useState(!1);return{handleToggle:(e,t)=>{const s=t==="1"?"0":"1";r(e,s),o(!0),p.post(u(g),{id:e,status:s},{preserveScroll:!0,preserveState:!0,replace:!0,onError:a=>{console.error("Toggle failed:",a),r(e,t)},onFinish:()=>o(!1)})},isToggling:l}};export{c as u};
