SPB Git forge

spb/house-ka

Public
18commits 1branches 0releases
1.9 MBsize
maindefault branch
19 days agolast push
Python 67% TypeScript 18.2% CSS 14.4%
6.6 KB · 189 lines tsx
Raw Blame History
1// -----------------------------------------------------------------------------2// Immo-Ka — Agrégateur de propriétés à vendre (province de Québec)3// Auteur : Simon-Pierre Boucher — contact@spboucher.ai4// components/Icons.tsx : iconographie MAISON — traits 1,7 px sur grille 24,5//   dessinée pour Immo-Ka (zéro emoji, zéro pack générique). Chaque icône est6//   un tracé « stroke » net qui hérite de la couleur du texte (currentColor).7// -----------------------------------------------------------------------------8import { ReactNode } from "react";910const P: Record<string, ReactNode> = {11  // --- navigation -----------------------------------------------------------12  home: (<>13    <path d="M3.5 10.6 12 3.4l8.5 7.2" />14    <path d="M5.6 9.4V20h12.8V9.4" />15    <path d="M10 20v-5.6h4V20" />16  </>),17  map: (<>18    <path d="M3.2 6.4 9 4.2l6 2.2 5.8-2.2v13.4L15 19.8l-6-2.2-5.8 2.2z" />19    <path d="M9 4.2v13.4M15 6.4v13.4" />20  </>),21  chart: (<>22    <path d="M4 20h16" />23    <path d="M7.2 20v-5.6M12 20V8.8M16.8 20V12" />24  </>),25  building: (<>26    <path d="M5 20V5.6A1.6 1.6 0 0 1 6.6 4h6.2a1.6 1.6 0 0 1 1.6 1.6V20" />27    <path d="M14.4 9.4h3.4A1.6 1.6 0 0 1 19.4 11v9" />28    <path d="M3.2 20h17.6" />29    <path d="M8 8h2.4M8 11.6h2.4M8 15.2h2.4M16.4 13h.9M16.4 16.2h.9" />30  </>),3132  // --- specs propriété --------------------------------------------------------33  bed: (<>34    <path d="M3.4 6.8V18.6" />35    <path d="M3.4 15.4h17.2v3.2" />36    <path d="M3.4 12.2h6.2v3.2" />37    <circle cx="6.5" cy="9.9" r="1.35" />38    <path d="M11.4 12.2h5.8a3.4 3.4 0 0 1 3.4 3.2" />39  </>),40  bath: (<>41    <path d="M3.6 12.4h16.8v1.4a5.2 5.2 0 0 1-5.2 5.2H8.8a5.2 5.2 0 0 1-5.2-5.2z" />42    <path d="M5.8 12.4V5.9a2.1 2.1 0 0 1 4-1" />43    <path d="m7 19.4-1 2.1M17 19.4l1 2.1" />44  </>),45  drop: (<>46    <path d="M12 3.6s6 6.4 6 10.6a6 6 0 1 1-12 0C6 10 12 3.6 12 3.6z" />47    <path d="M9.4 14.2a2.7 2.7 0 0 0 2 2.6" />48  </>),49  area: (<>50    <path d="M4.4 19.6 19.6 4.4" />51    <path d="M4.4 14v5.6H10" />52    <path d="M19.6 10V4.4H14" />53  </>),54  land: (<>55    <path d="M4.4 9.6v9.8M9.5 9.6v9.8M14.5 9.6v9.8M19.6 9.6v9.8" />56    <path d="M3 12.6h18M3 16.4h18" />57    <path d="M4.4 9.6 12 5.2l7.6 4.4" />58  </>),59  calendar: (<>60    <rect x="4" y="5.6" width="16" height="14.8" rx="2" />61    <path d="M4 10.2h16M8.2 3.4v4M15.8 3.4v4" />62  </>),63  tag: (<>64    <path d="m12.9 3.6 7.5 7.5a1.8 1.8 0 0 1 0 2.5l-6.8 6.8a1.8 1.8 0 0 1-2.5 0L3.6 12.9V3.6z" />65    <circle cx="8" cy="8" r="1.5" />66  </>),67  camera: (<>68    <rect x="3.4" y="7" width="17.2" height="13" rx="2" />69    <path d="M8.6 7 10 4.4h4L15.4 7" />70    <circle cx="12" cy="13.2" r="3.4" />71  </>),7273  // --- actions / états ----------------------------------------------------------74  search: (<>75    <circle cx="10.6" cy="10.6" r="6.2" />76    <path d="m15.3 15.3 5.3 5.3" />77  </>),78  arrow: (<>79    <path d="M4 12h15.2" />80    <path d="m13.8 6.4 5.4 5.6-5.4 5.6" />81  </>),82  check: (<path d="m5 12.8 4.3 4.4L19 7.4" />),83  alert: (<>84    <path d="M12 4.2 2.9 19.4h18.2z" />85    <path d="M12 10.2v4.4" />86    <path d="M12 17.4v.05" />87  </>),88  phone: (<path d="M5.2 4h3.6L10.4 8.4 8.3 10.1a12.5 12.5 0 0 0 5.6 5.6l1.7-2.1 4.4 1.6v3.6a1.8 1.8 0 0 1-1.9 1.8A16.4 16.4 0 0 1 3.4 5.9 1.8 1.8 0 0 1 5.2 4z" />),89  trendup: (<>90    <path d="m3.6 17.4 6-6.4 4 3.6 6.8-7.8" />91    <path d="M15.6 6.8h4.8v4.8" />92  </>),93  trenddown: (<>94    <path d="m3.6 6.8 6 6.4 4-3.6 6.8 7.8" />95    <path d="M15.6 17.4h4.8v-4.8" />96  </>),97  external: (<>98    <path d="M14.4 4h5.6v5.6" />99    <path d="M20 4 11.4 12.6" />100    <path d="M18.6 13.6V18a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V7.4a2 2 0 0 1 2-2h4.4" />101  </>),102  pin: (<>103    <path d="M12 21.2S5.4 15.7 5.4 10.8a6.6 6.6 0 0 1 13.2 0c0 4.9-6.6 10.4-6.6 10.4z" />104    <circle cx="12" cy="10.6" r="2.3" />105  </>),106  download: (<>107    <path d="M12 3.6v11.2" />108    <path d="m7.2 10.4 4.8 4.8 4.8-4.8" />109    <path d="M4.4 19.2h15.2" />110  </>),111112  // --- quartier ---------------------------------------------------------------------113  leaf: (<>114    <path d="M5 19.2C5 9.6 12 5 20 4.2c0 9-4.2 15-13.2 15z" />115    <path d="M5 19.2C7 14 11 10 15 8" />116  </>),117  thermo: (<>118    <path d="M10.4 4.2a1.9 1.9 0 0 1 3.8 0v8.8a4.2 4.2 0 1 1-3.8 0z" />119    <path d="M12.3 8.4v7" />120  </>),121  sun: (<>122    <circle cx="12" cy="12" r="4.2" />123    <path d="M12 3.2v2M12 18.8v2M3.2 12h2M18.8 12h2M5.8 5.8l1.4 1.4M16.8 16.8l1.4 1.4M18.2 5.8l-1.4 1.4M7.2 16.8l-1.4 1.4" />124  </>),125  shield: (<>126    <path d="M12 3.4 5.2 5.9v5.9c0 4.6 3 7.6 6.8 8.8 3.8-1.2 6.8-4.2 6.8-8.8V5.9z" />127    <path d="m9.2 12 2 2 3.8-4" />128  </>),129  cart: (<>130    <circle cx="9.6" cy="19.6" r="1.35" />131    <circle cx="17" cy="19.6" r="1.35" />132    <path d="M3.4 4.4h2.2l2.5 10.8h9.6l2.7-7.8H7" />133  </>),134  bus: (<>135    <rect x="4.6" y="3.8" width="14.8" height="13.4" rx="2.4" />136    <path d="M4.6 10.4h14.8" />137    <path d="M7.6 20.2v-3M16.4 20.2v-3" />138    <path d="M8.3 14h.05M15.7 14h.05" />139  </>),140  tree: (<>141    <path d="M12 3.4 6.8 11.4h2.8L5.4 17.8h13.2l-4.2-6.4h2.8z" />142    <path d="M12 17.8v3.4" />143  </>),144  school: (<>145    <path d="m12 4.2 9.8 4.4L12 13 2.2 8.6z" />146    <path d="M6.6 10.8v5c0 1.6 2.4 3 5.4 3s5.4-1.4 5.4-3v-5" />147    <path d="M21.8 8.6v5.4" />148  </>),149  health: (<>150    <circle cx="12" cy="12" r="8.4" />151    <path d="M12 8.4v7.2M8.4 12h7.2" />152  </>),153  pill: (<>154    <rect x="3.2" y="8.6" width="17.6" height="6.8" rx="3.4" transform="rotate(-33 12 12)" />155    <path d="M12 8.6v6.8" transform="rotate(-33 12 12)" />156  </>),157  people: (<>158    <circle cx="9" cy="8" r="3.2" />159    <path d="M3.6 20a5.4 5.4 0 0 1 10.8 0" />160    <path d="M15.4 5.4a3.2 3.2 0 0 1 0 5.9M17 14.8a5.4 5.4 0 0 1 3.4 5.2" />161  </>),162};163164export type IconName = keyof typeof P;165166export function Ico({ name, size = 18, className = "", stroke = 1.7 }:167  { name: IconName | string; size?: number; className?: string; stroke?: number }) {168  const paths = P[name as IconName];169  if (!paths) return null;170  return (171    <svg172      className={`ico ${className}`}173      width={size} height={size} viewBox="0 0 24 24"174      fill="none" stroke="currentColor" strokeWidth={stroke}175      strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"176    >177      {paths}178    </svg>179  );180}181182/** Version « chaîne HTML » pour les popups MapLibre (hors React). */183export function icoHTML(name: IconName, size = 30): string {184  const d: Record<string, string> = {185    home: '<path d="M3.5 10.6 12 3.4l8.5 7.2"/><path d="M5.6 9.4V20h12.8V9.4"/><path d="M10 20v-5.6h4V20"/>',186  };187  return `<svg width="${size}" height="${size}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">${d[name] ?? d.home}</svg>`;188}189