mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
2 lines
1.5 KiB
JavaScript
2 lines
1.5 KiB
JavaScript
import{d as p,x as i,p as _,c as s,o as e,j as t,t as u,G as h,H as v,_ as g}from"./framework.Bhsyh9kO.js";const f={class:"contributors-container"},b={key:0,class:"loading-state"},m={key:1,class:"error-state"},y={key:2,class:"contributors-grid"},k=["href","title"],w=["src","alt"],C={class:"contributor-name"},x=p({__name:"Contributors",setup(j){const c=i([]),l=i(!0),n=i(""),d=async()=>{try{l.value=!0,n.value="";const a=await fetch("https://api.github.com/repos/crazywhalecc/static-php-cli/contributors?per_page=24");if(!a.ok)throw new Error("Failed to fetch contributors");const o=await a.json();c.value=o}catch(a){n.value="Failed to load contributors. Please try again later.",console.error("Error fetching contributors:",a)}finally{l.value=!1}};return _(()=>{d()}),(a,o)=>(e(),s("div",f,[o[1]||(o[1]=t("div",{class:"contributors-header"},[t("h2",null,"Contributors"),t("p",{class:"contributors-description"}," Thanks to all the amazing people who have contributed to this project! ")],-1)),l.value?(e(),s("div",b,[...o[0]||(o[0]=[t("div",{class:"spinner"},null,-1),t("p",null,"Loading contributors...",-1)])])):n.value?(e(),s("div",m,[t("p",null,u(n.value),1)])):(e(),s("div",y,[(e(!0),s(h,null,v(c.value,r=>(e(),s("a",{key:r.id,href:r.html_url,target:"_blank",rel:"noopener noreferrer",class:"contributor-card",title:r.login},[t("img",{src:r.avatar_url,alt:r.login,class:"contributor-avatar",loading:"lazy"},null,8,w),t("div",C,u(r.login),1)],8,k))),128))]))]))}}),B=g(x,[["__scopeId","data-v-d508f059"]]);export{B as C};
|