2026-08-18 10:26:45 +02:00
|
|
|
import { GlobeSimple } from "@phosphor-icons/react/ssr";
|
2026-08-17 17:55:27 +02:00
|
|
|
import { BRAND_ICON_PATHS } from "@/lib/brand-icons";
|
|
|
|
|
|
2026-08-18 10:26:45 +02:00
|
|
|
// Generic (non-brand) icons that don't belong in BRAND_ICON_PATHS - for
|
|
|
|
|
// widgets that link to something with no single logo of its own.
|
|
|
|
|
const GENERIC_ICONS = {
|
|
|
|
|
globe: GlobeSimple,
|
|
|
|
|
};
|
|
|
|
|
|
2026-08-17 17:55:27 +02:00
|
|
|
export function BrandIcon({ slug, size = 18 }: { slug?: string; size?: number }) {
|
|
|
|
|
if (!slug) return null;
|
2026-08-18 10:26:45 +02:00
|
|
|
|
|
|
|
|
const GenericIcon = GENERIC_ICONS[slug as keyof typeof GENERIC_ICONS];
|
|
|
|
|
if (GenericIcon) {
|
|
|
|
|
return <GenericIcon size={size} className="shrink-0 text-fg-muted" aria-hidden />;
|
|
|
|
|
}
|
|
|
|
|
|
2026-08-17 17:55:27 +02:00
|
|
|
const path = BRAND_ICON_PATHS[slug];
|
|
|
|
|
if (!path) return null;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<svg width={size} height={size} viewBox="0 0 24 24" fill="currentColor" className="shrink-0 text-fg-muted" aria-hidden>
|
|
|
|
|
<path d={path} />
|
|
|
|
|
</svg>
|
|
|
|
|
);
|
|
|
|
|
}
|