import{a as C,j as s}from"./vendor-query-B2UbickB.js";import{L as u,E as j}from"./index-BZu5zewH.js";import{a0 as d,aI as N,aJ as f,ax as h}from"./vendor-icons-CrrAvF2g.js";function w({onRefresh:m,isFetching:r=!1,apiPath:e}){const[c,l]=C.useState(null),i=(t,a)=>{navigator.clipboard.writeText(t).then(()=>{l(a),setTimeout(()=>l(null),2e3)})},x=()=>{if(!e)return;const t=`${window.location.origin}${u}/api${e}`;i(t,"url")},p=()=>{if(!e)return;const t=`${window.location.origin}${u}/api${e}`,a=j(),$=a?`curl -H "Authorization: Bearer ${a}" "${t}"`:`curl "${t}"`;i($,"curl")},n="p-1 text-text-quaternary hover:text-accent transition-colors rounded",o="w-2.5 h-2.5";return s.jsxs("div",{className:"flex items-center gap-0.5",children:[e&&s.jsxs(s.Fragment,{children:[s.jsx("button",{onClick:x,className:n,title:"Copy API URL",children:c==="url"?s.jsx(d,{className:`${o} text-status-success`}):s.jsx(N,{className:o})}),s.jsx("button",{onClick:p,className:n,title:"Copy curl (includes auth token)",children:c==="curl"?s.jsx(d,{className:`${o} text-status-success`}):s.jsx(f,{className:o})})]}),s.jsx("button",{onClick:m,disabled:r,className:`${n} disabled:opacity-50`,title:"Refresh",children:s.jsx(h,{className:`${o} ${r?"animate-spin":""}`})})]})}export{w as L};
//# sourceMappingURL=ListToolbar-4lObXT3_.js.map
