// Icon.jsx — references SVG files in /assets/icons. Inherits currentColor via mask.
function Icon({ name, size = 16, className = "", style = {} }) {
  // Inline-mask trick lets currentColor work with same-origin SVGs in any state.
  const url = `../../assets/icons/${name}.svg`;
  return (
    <span
      role="img"
      aria-label={name}
      className={className}
      style={{
        display: "inline-block",
        width: size, height: size,
        background: "currentColor",
        WebkitMask: `url(${url}) center / contain no-repeat`,
        mask: `url(${url}) center / contain no-repeat`,
        flexShrink: 0,
        ...style,
      }}
    />
  );
}
window.Icon = Icon;
