--- import { TOOLS } from "@snapotter/shared"; const toolCount = TOOLS.length; function formatNumber(n: number): string { if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(1).replace(/\.0$/, "")}M`; if (n >= 1_000) return `${(n / 1_000).toFixed(1).replace(/\.0$/, "")}k`; return n.toString(); } let starCount = 0; try { const res = await fetch("https://api.github.com/repos/snapotter-hq/snapotter", { headers: { Accept: "application/vnd.github.v3+json" }, }); if (res.ok) { const data = await res.json(); starCount = data.stargazers_count ?? 0; } } catch { starCount = 0; } let dockerPulls = 0; try { const res = await fetch("https://hub.docker.com/v2/repositories/snapotter/snapotter/"); if (res.ok) { const data = await res.json(); dockerPulls = data.pull_count ?? 0; } } catch { dockerPulls = 0; } const stats = [ { value: toolCount.toString(), label: "Processing Tools", sublabel: "Across 5 file modalities", }, { value: starCount > 0 ? formatNumber(starCount) : "--", label: "GitHub Stars", sublabel: "Open-source & growing", href: "https://github.com/snapotter-hq/snapotter", }, { value: dockerPulls > 0 ? formatNumber(dockerPulls) : "--", label: "Docker Pulls", sublabel: "Deployed by organizations worldwide", href: "https://hub.docker.com/r/snapotter/snapotter", }, { value: "21", label: "Languages", sublabel: "Fully localized UI", }, ]; const badges = [ "GDPR Compliant", "Air-Gapped Ready", "SAML SSO", "Audit Logging", "Docker & K8s", "ARM + x86", ]; ---
{stats.map((stat) => { const inner = (

{stat.value}

{stat.label}

{stat.sublabel}

); return stat.href ? ( {inner} ) : (
{inner}
); })}
{badges.map((badge) => ( {badge} ))}