// Shared icons. Lucide-style line icons drawn inline so we don't pull deps.
// 1.5px stroke, 16px viewBox, currentColor.

const Icon = ({ name, size = 14 }) => {
  const paths = {
    user:        <><circle cx="8" cy="6" r="3"/><path d="M2 14c0-3 3-5 6-5s6 2 6 5"/></>,
    folder:      <><path d="M2 5a1 1 0 0 1 1-1h3l1.5 1.5H13a1 1 0 0 1 1 1V12a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1z"/></>,
    activity:    <><path d="M1 8h3l2-5 4 10 2-5h3"/></>,
    cpu:         <><rect x="4" y="4" width="8" height="8" rx="1"/><rect x="6.5" y="6.5" width="3" height="3"/><path d="M4 6.5H2M4 9.5H2M14 6.5h-2M14 9.5h-2M6.5 4V2M9.5 4V2M6.5 14v-2M9.5 14v-2"/></>,
    notebook:    <><path d="M3 2h9a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H3z M3 2v12 M5 5h6 M5 8h6 M5 11h4"/></>,
    radio:       <><circle cx="8" cy="8" r="1.5"/><path d="M5 5a4 4 0 0 0 0 6 M11 5a4 4 0 0 1 0 6 M3 3a7 7 0 0 0 0 10 M13 3a7 7 0 0 1 0 10"/></>,
    mail:        <><rect x="2" y="3.5" width="12" height="9" rx="1"/><path d="M2 4l6 5 6-5"/></>,
    arrowRight:  <><path d="M3 8h10 M9 4l4 4-4 4"/></>,
    arrowDown:   <><path d="M8 3v10 M4 9l4 4 4-4"/></>,
    plus:        <><path d="M8 3v10 M3 8h10"/></>,
    minus:       <><path d="M3 8h10"/></>,
    external:    <><path d="M9 3h4v4 M13 3l-6 6 M11 8v5H3V5h5"/></>,
    download:    <><path d="M8 2v9 M4 7l4 4 4-4 M2 13h12"/></>,
    layers:      <><path d="M8 2l6 3-6 3-6-3z M2 8l6 3 6-3 M2 11l6 3 6-3"/></>,
    target:      <><circle cx="8" cy="8" r="6"/><circle cx="8" cy="8" r="3"/><circle cx="8" cy="8" r=".5" fill="currentColor"/></>,
    wave:        <><path d="M1 8c2-3 3-3 5 0s3 3 5 0 3-3 5 0"/></>,
    grid:        <><rect x="2.5" y="2.5" width="4" height="4"/><rect x="9.5" y="2.5" width="4" height="4"/><rect x="2.5" y="9.5" width="4" height="4"/><rect x="9.5" y="9.5" width="4" height="4"/></>,
    triangle:    <><path d="M8 3l5 9H3z"/></>,
    chevronR:    <><path d="M6 4l4 4-4 4"/></>,
    chevronD:    <><path d="M4 6l4 4 4-4"/></>,
    print:       <><path d="M4 5V2h8v3 M4 12H2V6h12v6h-2 M4 9h8v5H4z"/></>,
    book:        <><path d="M3 3h4a2 2 0 0 1 2 2v9a2 2 0 0 0-2-2H3z M13 3H9a2 2 0 0 0-2 2v9a2 2 0 0 1 2-2h4z"/></>,
  };
  return (
    <svg width={size} height={size} viewBox="0 0 16 16" fill="none" stroke="currentColor"
      strokeWidth="1.4" strokeLinecap="round" strokeLinejoin="round" style={{ display: 'inline-block', verticalAlign: '-2px' }}>
      {paths[name] || null}
    </svg>
  );
};

window.Icon = Icon;
