portfolio/lib/dashboard.ts

28 lines
730 B
TypeScript
Raw Normal View History

2023-01-28 21:24:05 +00:00
import {getTotalFollowers, getTotalRepos, getTotalStars} from '@/lib/github'
export async function dashboard() {
const [totalRepos, totalFollowers] = await Promise.all([
getTotalRepos(),
getTotalFollowers()
])
const totalStars = await getTotalStars(totalRepos)
return [
{
title: "GitHub Repos",
total: totalRepos,
href: "https://github.com/r-freeman/"
},
{
title: "GitHub Followers",
total: totalFollowers,
href: "https://github.com/r-freeman/"
},
{
title: "GitHub Stars",
total: totalStars,
href: "https://github.com/r-freeman/"
}
]
}