'use client' import type { ContentListingIcon } from '~/lib/content-listings.schema' import { Axiom, Datadog, Grafana, Last9, Otlp, Sentry } from 'icons' import { Braces, Cloud, Server } from 'lucide-react' import type { ReactNode } from 'react' type IconKind = Extract['kind'] const ICON_KIND_COMPONENTS: Record = { braces: , otlp: , datadog: , grafana: , cloud: , sentry: , axiom: , last9: , server: , } export function resolveContentListingIcon( icon: ContentListingIcon | undefined ): ReactNode | string | undefined { if (icon && typeof icon === 'object') { return ( {ICON_KIND_COMPONENTS[icon.kind]} ) } // GlassPanel picks -light via next-themes; class-based dark: is more reliable for // Reflex (near-black light mark vanishes on dark cards if theme resolution lags). if (typeof icon === 'string' && icon.endsWith('/reflex-icon')) { return ( <> ) } return icon }