import Image from 'next/image';
import GitHubCalendar from 'react-github-calendar';
import { VscRepo, VscPerson } from 'react-icons/vsc';
import RepoCard from '@/components/RepoCard';
import { Repo, User } from '@/types';
import styles from '@/styles/GithubPage.module.css';
interface GithubPageProps {
repos: Repo[];
user: User;
}
const GithubPage = ({ repos, user }: GithubPageProps) => {
return (
GitHub
Browse through my GitHub repositories and see what I've been
working on. These are some of my public repositories showcasing
various projects and skills.
{user.login}
{user.public_repos} repositories
{user.followers} followers
Popular Repositories
{repos.map((repo) => (
))}
);
};
export async function getStaticProps() {
const userRes = await fetch(
`https://api.github.com/users/${process.env.NEXT_PUBLIC_GITHUB_USERNAME}`
);
const user = await userRes.json();
const repoRes = await fetch(
`https://api.github.com/users/${process.env.NEXT_PUBLIC_GITHUB_USERNAME}/repos?sort=pushed&per_page=6`
);
const repos = await repoRes.json();
return {
props: { title: 'GitHub', repos, user },
revalidate: 600,
};
}
export default GithubPage;