HubAPI / components /LLMProviderIconCloud.tsx
samirhosninet's picture
feat: update icon system with LobeHub provider logos
d3e44c7
Raw History Blame Contribute Delete
5.08 kB
"use client";
import Link from "next/link";
import { useLanguage } from "@/components/LanguageContext";
import { toLobeSvgUrl } from "@/data/llm-provider-icons";
import {
modelProviderCatalog,
inferencePlatformCatalog,
developerEcosystemCatalog,
type CatalogEntry,
} from "@/data/ecosystem-catalog";
const MONOCHROME_SLUGS = new Set([
"openai",
"anthropic",
"apple",
"grok",
"xai",
"zai",
"moonshot",
"ibm",
"ollama",
"github",
]);
function CatalogChip({ entry }: { entry: CatalogEntry }) {
const imgUrl = entry.slug ? toLobeSvgUrl(entry.slug) : null;
const isMonochrome = entry.slug ? MONOCHROME_SLUGS.has(entry.slug) : false;
return (
<div
className="flex shrink-0 items-center gap-3 rounded-xl border border-[var(--card-border)] bg-card/90 dark:bg-card/80 px-4 py-3 backdrop-blur-md"
aria-label={entry.label}
>
{imgUrl ? (
<div className="relative flex h-9 w-9 shrink-0 items-center justify-center p-1.5 bg-black/[0.02] dark:bg-white/5 border border-black/5 dark:border-white/10 rounded-lg">
{/* eslint-disable-next-line @next/next/no-img-element */}
<img
src={imgUrl}
alt=""
aria-hidden="true"
className={`h-full w-full object-contain ${
isMonochrome ? "invert dark:invert-0" : ""
}`}
loading="lazy"
decoding="async"
/>
</div>
) : (
<div
className="flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-primary/20 bg-primary/5 font-mono text-[10px] font-bold text-primary"
aria-hidden="true"
>
API
</div>
)}
<span className="font-mono text-[11px] font-bold tracking-wide text-foreground whitespace-nowrap">
{entry.label}
</span>
</div>
);
}
function CatalogCategory({
num,
title,
entries,
}: {
num: string;
title: string;
entries: CatalogEntry[];
}) {
return (
<div className="space-y-4">
<h3 className="font-mono text-xs font-bold uppercase tracking-widest text-muted-foreground">
<span className="text-primary/60">{num} /</span> {title}
</h3>
<div className="flex flex-wrap gap-2">
{entries.map((entry) => (
<CatalogChip key={entry.label} entry={entry} />
))}
</div>
</div>
);
}
export function LLMProviderIconCloud() {
const { t } = useLanguage();
return (
<section
id="models"
className="relative mx-auto flex w-full max-w-7xl flex-col items-center gap-12 py-24 px-4 md:px-6 overflow-hidden scroll-mt-24 border-t border-border"
>
<div className="text-center space-y-5 max-w-3xl mx-auto z-10 relative">
<div className="inline-flex items-center gap-2 rounded-full border border-primary/20 bg-primary/5 px-4 py-1.5 text-xs md:text-sm font-medium text-primary backdrop-blur-md shadow-lg font-mono tracking-widest uppercase">
<span className="w-1.5 h-1.5 rounded-full bg-primary animate-pulse shadow-[0_0_8px_var(--primary-glow)]" />
{t("ecoBadge")}
</div>
<h2 className="text-4xl font-extrabold tracking-tight sm:text-5xl md:text-6xl text-foreground leading-tight">
{t("ecoTitle")}
</h2>
<div className="space-y-3 text-sm md:text-base text-muted-foreground font-mono leading-relaxed">
<p>{t("ecoDesc")}</p>
<p className="text-primary/80 text-xs uppercase tracking-widest">{t("ecoDisclaimer")}</p>
</div>
</div>
<div className="relative w-full max-w-5xl premium-glass-card clip-cyber-card corner-bracket p-6 md:p-10 space-y-10 z-10">
<div className="corner-bracket-inner" aria-hidden="true" />
<div className="relative z-10 space-y-10">
<CatalogCategory
num="01"
title={t("ecoCat1Title")}
entries={modelProviderCatalog}
/>
<CatalogCategory
num="02"
title={t("ecoCat2Title")}
entries={inferencePlatformCatalog}
/>
<CatalogCategory
num="03"
title={t("ecoCat3Title")}
entries={developerEcosystemCatalog}
/>
</div>
</div>
<div className="flex flex-col sm:flex-row items-center justify-center gap-3 z-10">
<Link
href="#models"
className="inline-flex items-center justify-center px-6 py-3 font-mono text-sm font-bold uppercase tracking-widest border border-primary/40 bg-primary/10 text-primary hover:bg-primary/20 transition-colors clip-cyber-button"
>
{t("heroCtaViewModels")}
</Link>
<Link
href="#hero-waitlist"
className="inline-flex items-center justify-center px-6 py-3 font-mono text-sm font-bold uppercase tracking-widest bg-primary text-primary-foreground hover:opacity-90 transition-opacity clip-cyber-button shadow-[0_0_20px_var(--primary-glow)]"
>
{t("heroCtaGetKey")}
</Link>
</div>
</section>
);
}