25 lines
809 B
TypeScript
Raw Normal View History

import { HeroSection } from "@/components/hero"
import { RecentlyAddedIcons } from "@/components/recently-added-icons"
2025-04-24 18:22:15 +02:00
import { REPO_NAME } from "@/constants"
import { getRecentlyAddedIcons, getTotalIcons } from "@/lib/api"
2025-04-17 15:42:07 +02:00
async function getGitHubStars() {
const response = await fetch(`https://api.github.com/repos/${REPO_NAME}`)
const data = await response.json()
console.log(`GitHub stars: ${data.stargazers_count}`)
return data.stargazers_count
}
export default async function Home() {
const { totalIcons } = await getTotalIcons()
2025-04-17 11:38:32 +02:00
const recentIcons = await getRecentlyAddedIcons(10)
2025-04-17 15:42:07 +02:00
const stars = await getGitHubStars()
return (
<div className="flex flex-col min-h-screen">
2025-04-17 15:42:07 +02:00
<HeroSection totalIcons={totalIcons} stars={stars} />
<RecentlyAddedIcons icons={recentIcons} />
</div>
)
}