---
/* Icône d'une techno : SVG simple-icons (currentColor) si dispo,
   sinon monogramme. Taille pilotée par le CSS (.tile .ic). */
import { techIcons, monogram, type TechDef } from "../lib/techIcons";
interface Props { name: string; }
const { name } = Astro.props;
const def: TechDef | undefined = techIcons[name];
const path = def && "path" in def ? def.path : null;
const vb = def && "path" in def && def.vb ? def.vb : "0 0 24 24";
const fr = def && "path" in def && def.fr ? def.fr : undefined;
const mono = def && "mono" in def ? def.mono : monogram(name);
---
{path ? (
  <svg class="ic" viewBox={vb} fill="currentColor" aria-hidden="true">
    <path d={path} fill-rule={fr} />
  </svg>
) : (
  <span class="tile-mono">{mono}</span>
)}
