/* global React */
// ============================================================
// Icônes — SVG stroke géométriques, 24x24, currentColor
// ============================================================
const Ic = ({ d, size = 20, sw = 1.8, fill = "none", children, ...p }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill={fill}
       stroke="currentColor" strokeWidth={sw} strokeLinecap="round"
       strokeLinejoin="round" {...p}>
    {d ? <path d={d} /> : children}
  </svg>
);

const Icon = {
  grid:    (p) => <Ic {...p}><rect x="3" y="3" width="7" height="7" rx="1.5"/><rect x="14" y="3" width="7" height="7" rx="1.5"/><rect x="3" y="14" width="7" height="7" rx="1.5"/><rect x="14" y="14" width="7" height="7" rx="1.5"/></Ic>,
  home:    (p) => <Ic d="M3 11l9-8 9 8M5 10v10h14V10" {...p}/>,
  switcher:(p) => <Ic {...p}><rect x="4" y="4" width="7" height="16" rx="1.5"/><rect x="13" y="4" width="7" height="16" rx="1.5"/></Ic>,
  back:    (p) => <Ic d="M15 6l-6 6 6 6" {...p}/>,
  up:      (p) => <Ic d="M12 19V5M6 11l6-6 6 6" {...p}/>,
  down:    (p) => <Ic d="M12 5v14M6 13l6 6 6-6" {...p}/>,
  left:    (p) => <Ic d="M19 12H5M11 6l-6 6 6 6" {...p}/>,
  right:   (p) => <Ic d="M5 12h14M13 6l6 6-6 6" {...p}/>,
  scrollUp:(p) => <Ic d="M7 13l5-5 5 5M7 19l5-5 5 5" {...p}/>,
  scrollDown:(p)=> <Ic d="M7 5l5 5 5-5M7 11l5 5 5-5" {...p}/>,
  volUp:   (p) => <Ic d="M4 9v6h4l5 4V5L8 9H4zM17 8a5 5 0 010 8M19.5 5.5a9 9 0 010 13" {...p}/>,
  volDown: (p) => <Ic d="M4 9v6h4l5 4V5L8 9H4zM17 9.5a4 4 0 010 5" {...p}/>,
  refresh: (p) => <Ic d="M21 12a9 9 0 11-3-6.7M21 4v4h-4" {...p}/>,
  search:  (p) => <Ic {...p}><circle cx="11" cy="11" r="7"/><path d="M21 21l-4-4"/></Ic>,
  lock:    (p) => <Ic {...p}><rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V8a4 4 0 018 0v3"/></Ic>,
  unlock:  (p) => <Ic {...p}><rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V8a4 4 0 017.5-2"/></Ic>,
  battery: (p) => <Ic {...p}><rect x="2" y="8" width="17" height="9" rx="2"/><path d="M22 11v3"/></Ic>,
  wifi:    (p) => <Ic d="M5 12.5a10 10 0 0114 0M8 15.5a6 6 0 018 0M12 18.5h.01" {...p}/>,
  signal:  (p) => <Ic {...p} fill="currentColor" stroke="none"><rect x="3" y="14" width="3" height="6" rx="1"/><rect x="8" y="10" width="3" height="10" rx="1"/><rect x="13" y="6" width="3" height="14" rx="1"/><rect x="18" y="3" width="3" height="17" rx="1"/></Ic>,
  fullscreen:(p)=> <Ic d="M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5" {...p}/>,
  chevDown:(p) => <Ic d="M6 9l6 6 6-6" {...p}/>,
  chevRight:(p)=> <Ic d="M9 6l6 6-6 6" {...p}/>,
  plus:    (p) => <Ic d="M12 5v14M5 12h14" {...p}/>,
  check:   (p) => <Ic d="M5 12.5l4.5 4.5L19 6.5" {...p}/>,
  x:       (p) => <Ic d="M6 6l12 12M18 6L6 18" {...p}/>,
  image:   (p) => <Ic {...p}><rect x="3" y="4" width="18" height="16" rx="2"/><circle cx="9" cy="10" r="1.8"/><path d="M3 17l5-4 4 3 4-4 5 5"/></Ic>,
  user:    (p) => <Ic {...p}><circle cx="12" cy="8" r="4"/><path d="M4 21a8 8 0 0116 0"/></Ic>,
  users:   (p) => <Ic {...p}><circle cx="9" cy="8" r="3.5"/><path d="M2.5 20a6.5 6.5 0 0113 0M16 5.2a3.5 3.5 0 010 6.6M16.5 14.2A6.5 6.5 0 0121.5 20"/></Ic>,
  shield:  (p) => <Ic d="M12 3l7 3v5c0 4.5-3 8-7 10-4-2-7-5.5-7-10V6l7-3z" {...p}/>,
  phone:   (p) => <Ic {...p}><rect x="7" y="2.5" width="10" height="19" rx="2.5"/><path d="M11 18.5h2"/></Ic>,
  list:    (p) => <Ic d="M8 6h13M8 12h13M8 18h13M3.5 6h.01M3.5 12h.01M3.5 18h.01" {...p}/>,
  chart:   (p) => <Ic d="M4 4v16h16M8 16v-4M12 16V8M16 16v-7M20 16v-3" {...p}/>,
  settings:(p) => <Ic {...p}><circle cx="12" cy="12" r="3"/><path d="M12 2v3M12 19v3M4.2 4.2l2.1 2.1M17.7 17.7l2.1 2.1M2 12h3M19 12h3M4.2 19.8l2.1-2.1M17.7 6.3l2.1-2.1"/></Ic>,
  logout:  (p) => <Ic d="M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4M16 17l5-5-5-5M21 12H9" {...p}/>,
  dots:    (p) => <Ic {...p} fill="currentColor" stroke="none"><circle cx="5" cy="12" r="1.6"/><circle cx="12" cy="12" r="1.6"/><circle cx="19" cy="12" r="1.6"/></Ic>,
  send:    (p) => <Ic d="M4 12l16-7-7 16-2-7-7-2z" {...p}/>,
  eye:     (p) => <Ic {...p}><path d="M2 12s4-7 10-7 10 7 10 7-4 7-10 7-10-7-10-7z"/><circle cx="12" cy="12" r="3"/></Ic>,
  clock:   (p) => <Ic {...p}><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></Ic>,
  calendar:(p) => <Ic {...p}><rect x="3" y="5" width="18" height="16" rx="2"/><path d="M3 9h18M8 3v4M16 3v4"/></Ic>,
  filter:  (p) => <Ic d="M3 5h18l-7 8v6l-4-2v-4L3 5z" {...p}/>,
  bell:    (p) => <Ic d="M6 9a6 6 0 0112 0c0 5 2 6 2 6H4s2-1 2-6M10 20a2 2 0 004 0" {...p}/>,
  bolt:    (p) => <Ic d="M13 2L4 14h6l-1 8 9-12h-6l1-8z" {...p}/>,
  link:    (p) => <Ic d="M9 15l6-6M10.5 6.5l1-1a4 4 0 116 6l-1 1M13.5 17.5l-1 1a4 4 0 11-6-6l1-1" {...p}/>,
  download:(p) => <Ic d="M12 3v12M7 10l5 5 5-5M5 21h14" {...p}/>,
  copy:    (p) => <Ic {...p}><rect x="9" y="9" width="11" height="11" rx="2"/><path d="M5 15V5a2 2 0 012-2h8"/></Ic>,
  play:    (p) => <Ic {...p} fill="currentColor" stroke="none"><path d="M7 5l12 7-12 7z"/></Ic>,
  sun:     (p) => <Ic {...p}><circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M2 12h2M20 12h2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M19.1 4.9l-1.4 1.4M6.3 17.7l-1.4 1.4"/></Ic>,
  moon:    (p) => <Ic d="M21 12.8A8 8 0 1111.2 3a6.5 6.5 0 009.8 9.8z" {...p}/>,
  dot:     (p) => <Ic {...p} fill="currentColor" stroke="none"><circle cx="12" cy="12" r="5"/></Ic>,
  keyboard:(p) => <Ic {...p}><rect x="2" y="6" width="20" height="12" rx="2"/><path d="M6 10h.01M10 10h.01M14 10h.01M18 10h.01M6 14h12"/></Ic>,
  apps:    (p) => <Ic {...p}><circle cx="6" cy="6" r="2"/><circle cx="12" cy="6" r="2"/><circle cx="18" cy="6" r="2"/><circle cx="6" cy="12" r="2"/><circle cx="12" cy="12" r="2"/><circle cx="18" cy="12" r="2"/><circle cx="6" cy="18" r="2"/><circle cx="12" cy="18" r="2"/><circle cx="18" cy="18" r="2"/></Ic>,
  clipboard:(p)=> <Ic {...p}><rect x="5" y="4" width="14" height="17" rx="2"/><path d="M9 4V3a1 1 0 011-1h4a1 1 0 011 1v1M9 11h6M9 15h4"/></Ic>,
  whatsapp:(p) => <Ic {...p}><path d="M4 20l1.4-4A8 8 0 1112 20a8 8 0 01-3.6-.86L4 20z"/><path d="M9 9.5c0 3 2.5 5.5 5.5 5.5.6 0 1-.5 1-1l-1.6-.8-.9.9c-1-.5-1.8-1.3-2.3-2.3l.9-.9L10.7 9c0-.5-.4-1-1-1-.4 0-.7.2-.7.5z" fill="currentColor" stroke="none"/></Ic>,
  wallet:  (p) => <Ic {...p}><rect x="3" y="6" width="18" height="13" rx="2.5"/><path d="M3 10h18M16 14.5h.5"/></Ic>,
  euro:    (p) => <Ic d="M16 7a5 5 0 100 10M5 10h7M5 14h6" {...p}/>,
  receipt: (p) => <Ic {...p}><path d="M5 3v18l2-1.4 2 1.4 2-1.4 2 1.4 2-1.4 2 1.4V3l-2 1.4L13 3l-2 1.4L9 3 7 4.4 5 3z"/><path d="M8 8h8M8 12h6"/></Ic>,
  sim:     (p) => <Ic {...p}><path d="M7 3h7l4 4v13a1 1 0 01-1 1H7a1 1 0 01-1-1V4a1 1 0 011-1z"/><rect x="9" y="12" width="6" height="6" rx="1"/><path d="M9 15h6M12 12v6"/></Ic>,
  hash:    (p) => <Ic d="M9 4L7 20M17 4l-2 16M5 9h15M4 15h15" {...p}/>,
  telegram:(p) => <Ic {...p} fill="none"><path d="M21.5 4.3L2.8 11.3c-.7.3-.7 1.3.1 1.5l4.6 1.4 1.8 5.3c.2.6 1 .8 1.5.3l2.4-2.3 4.5 3.3c.5.4 1.3.1 1.4-.5l3-14.4c.2-.8-.6-1.4-1.1-1.1z"/><path d="M8 13.5l9-5.5-6.5 6.2"/></Ic>,
};

window.Icon = Icon;
