2025-04-16 16:18:20 +02:00
|
|
|
import { HeroSection } from "@/components/hero"
|
2025-04-17 02:43:14 +02:00
|
|
|
import { RecentlyAddedIcons } from "@/components/recently-added-icons"
|
2025-04-24 18:22:15 +02:00
|
|
|
import { REPO_NAME } from "@/constants"
|
2025-04-17 02:43:14 +02:00
|
|
|
import { getRecentlyAddedIcons, getTotalIcons } from "@/lib/api"
|
2025-04-16 16:18:20 +02:00
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2025-04-16 16:18:20 +02:00
|
|
|
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()
|
2025-04-16 16:18:20 +02:00
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="flex flex-col min-h-screen">
|
2025-04-17 15:42:07 +02:00
|
|
|
<HeroSection totalIcons={totalIcons} stars={stars} />
|
2025-04-17 02:43:14 +02:00
|
|
|
<RecentlyAddedIcons icons={recentIcons} />
|
2025-04-16 16:18:20 +02:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|