/* Powermieter — icon set. Minimal 1.75px line icons. Inherit currentColor. */
const Icon = ({ d, paths, children, size = 20, fill = 'none', sw = 1.75, ...rest }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill={fill} stroke="currentColor"
       strokeWidth={sw} strokeLinecap="round" strokeLinejoin="round" {...rest}>
    {d && <path d={d} />}
    {paths && paths.map((p, i) => <path key={i} {...(typeof p === 'string' ? { d: p } : p)} />)}
    {children}
  </svg>
);

const I = {
  check:    (p) => <Icon {...p} d="M20 6 9 17l-5-5" />,
  checkBold:(p) => <Icon sw={2.4} {...p} d="M20 6 9 17l-5-5" />,
  arrowR:   (p) => <Icon {...p} paths={["M5 12h14","M13 6l6 6-6 6"]} />,
  arrowL:   (p) => <Icon {...p} paths={["M19 12H5","M11 18l-6-6 6-6"]} />,
  chevDown: (p) => <Icon {...p} d="M6 9l6 6 6-6" />,
  chevRight:(p) => <Icon {...p} d="M9 6l6 6-6 6" />,
  x:        (p) => <Icon {...p} paths={["M18 6 6 18","M6 6l12 12"]} />,
  sun:      (p) => <Icon {...p} paths={["M12 2v2","M12 20v2","M4.9 4.9l1.4 1.4","M17.7 17.7l1.4 1.4","M2 12h2","M20 12h2","M4.9 19.1l1.4-1.4","M17.7 6.3l1.4-1.4"]}><circle cx="12" cy="12" r="4" /></Icon>,
  moon:     (p) => <Icon {...p} d="M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z" />,
  phone:    (p) => <Icon {...p}><rect x="7" y="2.5" width="10" height="19" rx="2.5" /><path d="M10.5 18.5h3" /></Icon>,
  desktop:  (p) => <Icon {...p}><rect x="2.5" y="4" width="19" height="12" rx="2" /><path d="M8 20h8M12 16v4" /></Icon>,
  // Energy / brand
  bolt:     (p) => <Icon fill="none" {...p} d="M13 2 4 14h7l-1 8 9-12h-7l1-8z" />,
  sun2:     (p) => <Icon {...p}><circle cx="12" cy="12" r="4.2"/><path d="M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.2 5.2l1.4 1.4M17.4 17.4l1.4 1.4M18.8 5.2l-1.4 1.4M6.6 17.4l-1.4 1.4"/></Icon>,
  building: (p) => <Icon {...p}><path d="M4 21V5a1 1 0 0 1 1-1h9a1 1 0 0 1 1 1v16"/><path d="M15 9h4a1 1 0 0 1 1 1v11"/><path d="M2 21h20"/><path d="M8 8h.01M11 8h.01M8 12h.01M11 12h.01M8 16h.01M11 16h.01"/></Icon>,
  home:     (p) => <Icon {...p} paths={["M3 10.5 12 3l9 7.5","M5 9.5V21h14V9.5"]} />,
  leaf:     (p) => <Icon {...p} paths={["M11 20A7 7 0 0 1 4 13c0-5 4-9 16-9 0 9-4 13-9 13z","M9 17c2-4 4-6 8-8"]} />,
  wallet:   (p) => <Icon {...p}><rect x="3" y="6" width="18" height="14" rx="2.5"/><path d="M3 10h18M16 14h2"/></Icon>,
  receipt:  (p) => <Icon {...p}><path d="M5 21V4a1 1 0 0 1 1.4-.9l1.6.8 2-1 2 1 2-1 2 1 1.6-.8A1 1 0 0 1 20 4v17l-2-1-2 1-2-1-2 1-2-1-3 1z"/><path d="M9 8h6M9 12h6"/></Icon>,
  shield:   (p) => <Icon {...p} paths={["M12 3 5 6v5c0 4.5 3 7.5 7 9 4-1.5 7-4.5 7-9V6l-7-3z","M9 12l2 2 4-4"]} />,
  lock:     (p) => <Icon {...p}><rect x="4.5" y="10.5" width="15" height="10" rx="2"/><path d="M8 10.5V7a4 4 0 0 1 8 0v3.5"/></Icon>,
  info:     (p) => <Icon {...p}><circle cx="12" cy="12" r="9"/><path d="M12 11v5M12 8h.01"/></Icon>,
  help:     (p) => <Icon {...p}><circle cx="12" cy="12" r="9"/><path d="M9.3 9.3a2.7 2.7 0 0 1 5.2 1c0 1.8-2.7 2.5-2.7 2.5M12 17h.01"/></Icon>,
  alert:    (p) => <Icon {...p}><path d="M12 9v4M12 17h.01"/><path d="M10.3 3.8 2.4 18a2 2 0 0 0 1.7 3h15.8a2 2 0 0 0 1.7-3L13.7 3.8a2 2 0 0 0-3.4 0z"/></Icon>,
  user:     (p) => <Icon {...p}><circle cx="12" cy="8" r="3.6"/><path d="M5 20a7 7 0 0 1 14 0"/></Icon>,
  mail:     (p) => <Icon {...p}><rect x="3" y="5" width="18" height="14" rx="2.5"/><path d="m4 7 8 6 8-6"/></Icon>,
  doc:      (p) => <Icon {...p}><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5M9 13h6M9 17h6"/></Icon>,
  download: (p) => <Icon {...p} paths={["M12 3v12","M7 11l5 5 5-5","M5 21h14"]} />,
  upload:   (p) => <Icon {...p} paths={["M12 16V4","M7 9l5-5 5 5","M5 20h14"]} />,
  camera:   (p) => <Icon {...p}><path d="M4 8.5A1.5 1.5 0 0 1 5.5 7H8l1.2-2h5.6L16 7h2.5A1.5 1.5 0 0 1 20 8.5V18a1.5 1.5 0 0 1-1.5 1.5h-13A1.5 1.5 0 0 1 4 18z"/><circle cx="12" cy="12.5" r="3.2"/></Icon>,
  meter:    (p) => <Icon {...p}><circle cx="12" cy="12" r="9"/><path d="M12 12 15.5 8.5M7 12h.5M17 12h.5M12 7v.5"/></Icon>,
  clock:    (p) => <Icon {...p}><circle cx="12" cy="12" r="9"/><path d="M12 7.5V12l3 2"/></Icon>,
  calendar: (p) => <Icon {...p}><rect x="3.5" y="5" width="17" height="16" rx="2.5"/><path d="M3.5 9.5h17M8 3v4M16 3v4"/></Icon>,
  qr:       (p) => <Icon sw={1.6} {...p}><rect x="3.5" y="3.5" width="6" height="6" rx="1"/><rect x="14.5" y="3.5" width="6" height="6" rx="1"/><rect x="3.5" y="14.5" width="6" height="6" rx="1"/><path d="M14.5 14.5h2.5v2.5M20.5 14.5v2.5M14.5 20.5h2.5M20.5 20.5v.01M17 17v3.5"/></Icon>,
  filter:   (p) => <Icon {...p} d="M3 5h18l-7 8v6l-4 2v-8L3 5z" />,
  search:   (p) => <Icon {...p}><circle cx="11" cy="11" r="6.5"/><path d="m20 20-3.5-3.5"/></Icon>,
  send:     (p) => <Icon {...p} paths={["M22 2 11 13","M22 2 15 22l-4-9-9-4 20-7z"]} />,
  note:     (p) => <Icon {...p}><path d="M5 4h14a1 1 0 0 1 1 1v10l-5 5H6a1 1 0 0 1-1-1z"/><path d="M14 20v-5h5M9 9h6M9 13h3"/></Icon>,
  grid:     (p) => <Icon {...p}><rect x="3.5" y="3.5" width="7" height="7" rx="1.5"/><rect x="13.5" y="3.5" width="7" height="7" rx="1.5"/><rect x="3.5" y="13.5" width="7" height="7" rx="1.5"/><rect x="13.5" y="13.5" width="7" height="7" rx="1.5"/></Icon>,
  list:     (p) => <Icon {...p} paths={["M8 6h13","M8 12h13","M8 18h13","M3.5 6h.01","M3.5 12h.01","M3.5 18h.01"]} />,
  users:    (p) => <Icon {...p}><circle cx="9" cy="8" r="3.2"/><path d="M3.5 19a5.5 5.5 0 0 1 11 0"/><path d="M16 5.2a3.2 3.2 0 0 1 0 5.6M16.5 19a5.5 5.5 0 0 0-2-4.3"/></Icon>,
  signature:(p) => <Icon {...p} paths={["M3 18c2 0 3-1 4-4s2-7 3-7 1 3 1.5 5 1 3 2 3 1.5-2 2.5-2 1.5 1 2.5 1","M3 21h18"]} />,
  chart:    (p) => <Icon {...p} paths={["M4 4v16h16","M8 15v3","M12 10v8","M16 6v12"]} />,
  refresh:  (p) => <Icon {...p} paths={["M20 11a8 8 0 0 0-14-4.5L4 8","M4 4v4h4","M4 13a8 8 0 0 0 14 4.5L20 16","M20 20v-4h-4"]} />,
  spark:    (p) => <Icon {...p} d="M12 3v4M12 17v4M3 12h4M17 12h4M12 9.5a2.5 2.5 0 0 0 0 5 2.5 2.5 0 0 0 0-5z" />,
  plug:     (p) => <Icon {...p} paths={["M9 2v6","M15 2v6","M7 8h10v3a5 5 0 0 1-10 0V8z","M12 16v4"]} />,
  dot:      (p) => <Icon fill="currentColor" stroke="none" {...p}><circle cx="12" cy="12" r="4" /></Icon>,
  star:     (p) => <Icon {...p} d="m12 3 2.6 5.3 5.9.9-4.3 4.1 1 5.8L12 16.9 6.8 19.1l1-5.8L3.5 9.2l5.9-.9L12 3z" />,
  external: (p) => <Icon {...p} paths={["M14 4h6v6","M20 4 11 13","M19 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1h5"]} />,
  menu:     (p) => <Icon {...p} paths={["M4 6h16","M4 12h16","M4 18h16"]} />,
};

window.I = I;
window.Icon = Icon;
