import { getAllIcons } from "@/lib/api" import { ImageResponse } from "next/og" export const dynamic = "force-static" export const size = { width: 1200, height: 630, } // Define a fixed list of representative icons const representativeIcons = [ "github", "discord", "slack", "docker", "kubernetes", "grafana", "prometheus", "nextcloud", "homeassistant", "cloudflare", "nginx", "traefik", "portainer", "plex", "jellyfin", ] export default async function Image() { const iconsData = await getAllIcons() const totalIcons = Object.keys(iconsData).length // Round down to the nearest 100 const roundedTotalIcons = Math.floor(totalIcons / 100) * 100 const iconImages = representativeIcons.map((icon) => ({ name: icon .split("-") .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) .join(" "), url: `https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/${icon}.png`, })) return new ImageResponse(
Dashboard Icons
A curated collection of {roundedTotalIcons}+ free icons for dashboards and app directories
{iconImages.map((icon, index) => (
{icon.name}
))}
+{totalIcons - representativeIcons.length}
dashboardicons.com
, { ...size, }, ) }