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-18 12:39:37 +02:00
|
|
|
import { BASE_URL, getDescription, REPO_NAME, websiteTitle } from "@/constants"
|
2025-04-17 02:43:14 +02:00
|
|
|
import { getRecentlyAddedIcons, getTotalIcons } from "@/lib/api"
|
2025-04-16 16:18:20 +02:00
|
|
|
import type { Metadata } from "next"
|
|
|
|
|
2025-04-16 22:51:23 +02:00
|
|
|
export async function generateMetadata(): Promise<Metadata> {
|
|
|
|
const { totalIcons } = await getTotalIcons()
|
|
|
|
|
|
|
|
return {
|
2025-04-18 12:39:37 +02:00
|
|
|
title: websiteTitle,
|
|
|
|
description: getDescription(totalIcons),
|
2025-04-17 02:43:14 +02:00
|
|
|
keywords: ["dashboard icons", "service icons", "application icons", "tool icons", "web dashboard", "app directory"],
|
2025-04-16 22:51:23 +02:00
|
|
|
openGraph: {
|
2025-04-18 12:39:37 +02:00
|
|
|
title: websiteTitle,
|
|
|
|
description: getDescription(totalIcons),
|
2025-04-16 22:51:23 +02:00
|
|
|
type: "website",
|
|
|
|
url: BASE_URL,
|
|
|
|
images: [
|
|
|
|
{
|
|
|
|
url: "/og-image.png",
|
|
|
|
width: 1200,
|
|
|
|
height: 630,
|
|
|
|
alt: "Dashboard Icons",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
twitter: {
|
2025-04-18 12:39:37 +02:00
|
|
|
title: websiteTitle,
|
|
|
|
description: getDescription(totalIcons),
|
2025-04-16 22:51:23 +02:00
|
|
|
card: "summary_large_image",
|
|
|
|
images: ["/og-image.png"],
|
|
|
|
},
|
|
|
|
alternates: {
|
|
|
|
canonical: BASE_URL,
|
|
|
|
},
|
|
|
|
}
|
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>
|
|
|
|
)
|
|
|
|
}
|