import type { AboutTechItem } from "@/data/aboutTechnologies";

const SIMPLE_ICONS_CDN = "https://cdn.simpleicons.org";

/** URL do logo oficial (Simple Icons CDN ou asset local). */
export function getTechLogoUrl(item: Pick<AboutTechItem, "logoSlug" | "brandColor" | "logoSrc">): string {
  if (item.logoSrc) return item.logoSrc;
  const slug = item.logoSlug;
  if (item.brandColor) {
    return `${SIMPLE_ICONS_CDN}/${slug}/${item.brandColor}`;
  }
  return `${SIMPLE_ICONS_CDN}/${slug}`;
}
