import Head from 'next/head' import {SimpleLayout} from '@/components/SimpleLayout' import {Card} from '@/components/Card' import {numberFormat} from '@/lib/numberFormat' import {getTotalFollowers, getTotalRepos, getTotalStars} from '@/lib/github' import {GetStaticProps} from 'next' type DashboardProps = { totalRepos: number totalFollowers: number totalStars: number } export default function Dashboard({totalRepos, totalFollowers, totalStars}: DashboardProps) { return ( <> Dashboard - Ryan Freeman ) } export const getStaticProps: GetStaticProps = async () => { const [totalRepos, totalFollowers] = await Promise.all([ getTotalRepos(), getTotalFollowers() ]) const totalStars = await getTotalStars(totalRepos) return { props: { totalRepos, totalFollowers, totalStars } } }