diff --git a/lib/dashboard.ts b/lib/dashboard.ts index 7677201..be0e4e6 100644 --- a/lib/dashboard.ts +++ b/lib/dashboard.ts @@ -9,33 +9,33 @@ export async function dashboard() { ]) const totalStars = await getTotalStars(totalRepos) - const articles = await getAllArticles() - const {views} = await getViews() + const totalArticles = (await getAllArticles()).length + const totalArticleViews = (await getViews()).views return [ { title: "GitHub Repos", - total: totalRepos, + metric: totalRepos, href: "https://github.com/r-freeman?tab=repositories" }, { title: "GitHub Followers", - total: totalFollowers, + metric: totalFollowers, href: "https://github.com/r-freeman?tab=followers" }, { title: "GitHub Stars", - total: totalStars, + metric: totalStars, href: "https://github.com/r-freeman/" }, { title: "Total Articles", - total: articles.length, + metric: totalArticles, href: "/writing" }, { title: "Total Article Views", - total: views, + metric: totalArticleViews, href: "/writing" } ] diff --git a/pages/dashboard.tsx b/pages/dashboard.tsx index cf9f5ab..2a787aa 100644 --- a/pages/dashboard.tsx +++ b/pages/dashboard.tsx @@ -7,7 +7,7 @@ import {dashboard} from '@/lib/dashboard' type CardProps = { title: string - total: number + metric: number href: string } @@ -44,7 +44,7 @@ export default function Dashboard({cards}: { cards: CardProps[] }) { {card.title} - {numberFormat(card.total)} + {numberFormat(card.metric)} ))} @@ -57,7 +57,7 @@ export default function Dashboard({cards}: { cards: CardProps[] }) { export const getStaticProps: GetStaticProps = async () => { return { props: { - cards: (await dashboard()) + cards: await dashboard() } } }