import{i as e,o as t}from"./button-DJ30HgDO.js";import{t as n}from"./use-api-BQhcC0Jo.js";import{a as r,r as i}from"./workspace-service-Cl6oPc5h.js";var a=t(e(),1);function o(){let{data:e,isLoading:t,error:o,refetch:s}=n(i),c=e?.workspaces??null,[l,u]=(0,a.useState)(null);return(0,a.useEffect)(()=>{if(!c?.length){u(null);return}let e=new AbortController;return Promise.all(c.map(async t=>{let n=await r(t.name,e.signal);return[t.name,n]})).then(t=>{e.signal.aborted||u(Object.fromEntries(t))}).catch(()=>{}),()=>e.abort()},[c]),{allWorkspaces:c,memberCounts:l,isLoading:t,error:o,refresh:s}}export{o as t};