// Pictogrammes line-style — SVG simples, géométriques

const Icon = ({ name, size = 20, stroke = 1.5, color = 'currentColor' }) => {
  const props = {
    width: size,
    height: size,
    viewBox: '0 0 24 24',
    fill: 'none',
    stroke: color,
    strokeWidth: stroke,
    strokeLinecap: 'round',
    strokeLinejoin: 'round',
  };
  switch (name) {
    case 'gear': // mécanique / fonctionnement
      return (
        <svg {...props}>
          <circle cx="12" cy="12" r="3" />
          <path d="M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.1 2.1M17 17l2.1 2.1M4.9 19.1l2.1-2.1M17 7l2.1-2.1" />
        </svg>
      );
    case 'rules': // règles / contraintes
      return (
        <svg {...props}>
          <rect x="3" y="4" width="18" height="16" rx="1" />
          <path d="M3 9h18M8 4v16" />
        </svg>
      );
    case 'star': // avantages
      return (
        <svg {...props}>
          <path d="M12 3l2.6 5.4 5.9.8-4.3 4.1 1 5.9L12 16.4 6.8 19.2l1-5.9L3.5 9.2l5.9-.8L12 3z" />
        </svg>
      );
    case 'warning': // vigilance
      return (
        <svg {...props}>
          <path d="M12 3L2 20h20L12 3z" />
          <path d="M12 10v5M12 17.5v.1" />
        </svg>
      );
    case 'euro':
      return (
        <svg {...props}>
          <path d="M16 6a6 6 0 100 12M4 10h9M4 14h9" />
        </svg>
      );
    case 'clock':
      return (
        <svg {...props}>
          <circle cx="12" cy="12" r="9" />
          <path d="M12 7v5l3 2" />
        </svg>
      );
    case 'shield':
      return (
        <svg {...props}>
          <path d="M12 3l8 3v6c0 4.5-3.5 8-8 9-4.5-1-8-4.5-8-9V6l8-3z" />
        </svg>
      );
    case 'user':
      return (
        <svg {...props}>
          <circle cx="12" cy="8" r="3.5" />
          <path d="M5 20c1-3.5 4-5 7-5s6 1.5 7 5" />
        </svg>
      );
    case 'lock':
      return (
        <svg {...props}>
          <rect x="5" y="11" width="14" height="9" rx="1" />
          <path d="M8 11V8a4 4 0 018 0v3" />
        </svg>
      );
    case 'arrowRight':
      return (
        <svg {...props}>
          <path d="M5 12h14M13 6l6 6-6 6" />
        </svg>
      );
    case 'check':
      return (
        <svg {...props}>
          <path d="M5 12l4 4L19 6" />
        </svg>
      );
    case 'plus':
      return (
        <svg {...props}>
          <path d="M12 5v14M5 12h14" />
        </svg>
      );
    case 'minus':
      return (
        <svg {...props}>
          <path d="M5 12h14" />
        </svg>
      );
    case 'building': // immobilier
      return (
        <svg {...props}>
          <rect x="4" y="3" width="16" height="18" />
          <path d="M9 8h2M13 8h2M9 12h2M13 12h2M9 16h2M13 16h2M10 21v-3h4v3" />
        </svg>
      );
    case 'factory': // industriel
      return (
        <svg {...props}>
          <path d="M3 21V11l5 3V11l5 3V8l8-4v17H3z" />
          <path d="M7 17h2M11 17h2M15 17h2" />
        </svg>
      );
    case 'spark': // innovation
      return (
        <svg {...props}>
          <path d="M12 2v4M12 18v4M2 12h4M18 12h4M5 5l3 3M16 16l3 3M5 19l3-3M16 8l3-3" />
        </svg>
      );
    case 'doc':
      return (
        <svg {...props}>
          <path d="M6 3h9l4 4v14H6V3z" />
          <path d="M15 3v4h4M9 12h7M9 16h7M9 8h2" />
        </svg>
      );
    case 'phone':
      return (
        <svg {...props}>
          <path d="M5 4h4l2 5-2.5 1.5a11 11 0 005 5L15 13l5 2v4a2 2 0 01-2 2A15 15 0 013 6a2 2 0 012-2z" />
        </svg>
      );
    case 'piggy': // épargne retraite
      return (
        <svg {...props}>
          <path d="M5 13a6 6 0 016-6h3a6 6 0 016 6v2l2 1v3h-3l-1 2h-3l-1-2H8l-1 2H4v-3a6 6 0 011-3.5z" />
          <circle cx="9" cy="13" r="0.8" fill={color} stroke="none" />
          <path d="M14 7V5" />
        </svg>
      );
    case 'hammer': // travaux / rénovation (Denormandie)
      return (
        <svg {...props}>
          <path d="M14 3l7 7-3 3-7-7 3-3z" />
          <path d="M11 6L3 14l4 4 8-8" />
        </svg>
      );
    case 'column': // monuments historiques
      return (
        <svg {...props}>
          <path d="M3 21h18M5 21V8h14v13M5 8l7-5 7 5M9 21V11M15 21V11" />
        </svg>
      );
    case 'leaf': // déficit foncier / éco
      return (
        <svg {...props}>
          <path d="M5 19c0-8 5-14 16-14 0 11-6 16-14 16-1 0-2-1-2-2z" />
          <path d="M5 19l7-7" />
        </svg>
      );
    case 'home': // loc'avantages / logement
      return (
        <svg {...props}>
          <path d="M3 11l9-7 9 7v9a1 1 0 01-1 1h-5v-6h-6v6H4a1 1 0 01-1-1v-9z" />
        </svg>
      );
    case 'pme': // IR-PME (entreprise / handshake stylisé)
      return (
        <svg {...props}>
          <rect x="3" y="9" width="8" height="11" rx="1" />
          <rect x="13" y="4" width="8" height="16" rx="1" />
          <path d="M6 13h2M6 16h2M16 8h2M16 12h2M16 16h2" />
        </svg>
      );
    case 'film': // SOFICA / cinéma
      return (
        <svg {...props}>
          <rect x="3" y="5" width="18" height="14" rx="1" />
          <path d="M3 9h18M3 15h18M7 5v14M17 5v14" />
        </svg>
      );
    case 'heart': // dons / mécénat
      return (
        <svg {...props}>
          <path d="M12 20s-7-4.5-7-10a4 4 0 017-2.5A4 4 0 0119 10c0 5.5-7 10-7 10z" />
        </svg>
      );
    case 'sparkle-new': // nouveauté LF 2026
      return (
        <svg {...props}>
          <path d="M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8L12 3z" />
          <path d="M19 4v3M17.5 5.5h3M5 17v3M3.5 18.5h3" />
        </svg>
      );
    case 'tree': // forêt / GFI (sapin stylisé)
      return (
        <svg {...props}>
          <path d="M12 3L7 9h3l-4 5h3l-4 5h14l-4-5h3l-4-5h3L12 3z" />
          <path d="M11 19v3h2v-3" />
        </svg>
      );
    case 'helping': // services à la personne (maison + cœur)
      return (
        <svg {...props}>
          <path d="M3 11l9-7 9 7v9a1 1 0 01-1 1H4a1 1 0 01-1-1v-9z" />
          <path d="M12 18s-3-1.8-3-4a2 2 0 013-1.5A2 2 0 0115 14c0 2.2-3 4-3 4z" />
        </svg>
      );
    case 'baby': // garde d'enfants (silhouette enfant)
      return (
        <svg {...props}>
          <circle cx="12" cy="7" r="3" />
          <path d="M6 21c0-3.5 2.5-5.5 6-5.5s6 2 6 5.5" />
          <path d="M10 7.5l-1 1M14 7.5l1 1" />
        </svg>
      );
    default:
      return null;
  }
};

window.Icon = Icon;
