import{u as o,r,j as u}from"./index-gnHkq9KV.js";function f({onRefresh:t,title:c="Refresh"}){const{t:n}=o(),[e,s]=r.useState("idle"),a=r.useCallback(async()=>{if(e!=="refreshing"){s("refreshing");try{await t(),s("success"),setTimeout(()=>s("idle"),1200)}catch{s("idle")}}},[t,e]),i=["btn btn-sm refresh-btn",e==="refreshing"?"refreshing":"",e==="success"?"refresh-success":""].filter(Boolean).join(" ");return u.jsx("button",{className:i,onClick:a,title:n(c),children:e==="success"?"✓":"↻"})}export{f as R};
