import Container from './Container';
import DiscordIcon from './icons/DiscordIcon';
import EmailIcon from './icons/EmailIcon';
import GitHubIcon from './icons/GitHubIcon';
import { siteConfig } from '@/config/siteConfig';
import { getContributorsCount, getRepoInfo } from '@/lib/getGitHubData';
import { useEffect, useState } from 'react';
const Stat = ({ title, value, ...props }) => {
return (
);
};
const IconButton = ({ Icon, text, href, ...props }) => {
return (
);
};
export default function Community() {
const [repoInfo, setRepoInfo] = useState();
const [contributorsCount, setContributorsCount] = useState('');
useEffect(() => {
// This runs on client side and it's unlikely that users
// will exceed the GitHub API usage limit, but added a
// handling for that just in case.
getRepoInfo().then((res) => {
if (res.success) {
res.info.then((data) => setRepoInfo(data));
} else {
// If the request fail e.g API usage limit, use
// a placeholder
setRepoInfo({ stargazers_count: '+2k' });
}
});
getContributorsCount().then((res) => {
if (res.success) {
setContributorsCount(res.count);
} else {
setContributorsCount('+70');
}
});
}, []);
return (
Community
We are growing. Get in touch or become a contributor!
);
}