/* =========================================================
   三藏閣 — 아이콘 (인라인 SVG · 1.5px stroke · 24px)
   ========================================================= */

window.Icon = ({ name, size = 20, className = '' }) => {
  const s = size;
  const props = {
    width: s, height: s, viewBox: '0 0 24 24',
    fill: 'none', stroke: 'currentColor', strokeWidth: 1.5,
    strokeLinecap: 'round', strokeLinejoin: 'round',
    className,
  };
  switch (name) {
    case 'menu':
      return <svg {...props}><path d="M4 7h16M4 12h16M4 17h16"/></svg>;
    case 'close':
      return <svg {...props}><path d="M6 6l12 12M18 6L6 18"/></svg>;
    case 'search':
      return <svg {...props}><circle cx="11" cy="11" r="6.5"/><path d="m20 20-3.5-3.5"/></svg>;
    case 'aA':
      return <svg {...props}><path d="M3 18 8 5l5 13M5 14h6M14 18h2.5l3-9 3 9H22M16 15h4"/></svg>;
    case 'bookmark':
      return <svg {...props}><path d="M6 4h12v17l-6-4-6 4z"/></svg>;
    case 'bookmark-fill':
      return <svg {...props} fill="currentColor"><path d="M6 4h12v17l-6-4-6 4z"/></svg>;
    case 'highlight':
      return <svg {...props}><path d="M14 4l6 6-9 9H5v-6z"/><path d="M11 7l6 6"/></svg>;
    case 'note':
      return <svg {...props}><path d="M5 4h12l3 3v13H5z"/><path d="M8 10h8M8 14h6"/></svg>;
    case 'speaker':
      return <svg {...props}><path d="M5 9v6h4l5 4V5L9 9zM17 9a4 4 0 0 1 0 6"/></svg>;
    case 'link':
      return <svg {...props}><path d="M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1"/><path d="M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1"/></svg>;
    case 'caret':
      return <svg {...props}><path d="m9 6 6 6-6 6"/></svg>;
    case 'caret-down':
      return <svg {...props}><path d="m6 9 6 6 6-6"/></svg>;
    case 'arrow-left':
      return <svg {...props}><path d="M19 12H5M12 5l-7 7 7 7"/></svg>;
    case 'arrow-right':
      return <svg {...props}><path d="M5 12h14M12 5l7 7-7 7"/></svg>;
    case 'pen':
      return <svg {...props}><path d="M15 4l5 5L9 20H4v-5z"/><path d="M12 7l5 5"/></svg>;
    case 'quote':
      return <svg {...props}><path d="M7 17q-3 0-3-3v-3a3 3 0 0 1 3-3h2v3H7v3h3v3z"/><path d="M17 17q-3 0-3-3v-3a3 3 0 0 1 3-3h2v3h-2v3h3v3z"/></svg>;
    case 'home':
      return <svg {...props}><path d="M4 11 12 4l8 7v9h-5v-6H9v6H4z"/></svg>;
    case 'panel-left':
      return <svg {...props}><rect x="3" y="4" width="18" height="16" rx="1.5"/><path d="M9 4v16"/></svg>;
    case 'panel-right':
      return <svg {...props}><rect x="3" y="4" width="18" height="16" rx="1.5"/><path d="M15 4v16"/></svg>;
    case 'circle':
      return <svg {...props}><circle cx="12" cy="12" r="8"/></svg>;
    case 'lotus':
      return <svg {...props}><path d="M12 19c-4-1-7-4-7-8 2 0 4 1 5 3 0-3 1-6 2-8 1 2 2 5 2 8 1-2 3-3 5-3 0 4-3 7-7 8z"/></svg>;
    case 'check':
      return <svg {...props}><path d="m5 12 5 5 9-11"/></svg>;
    case 'plus':
      return <svg {...props}><path d="M12 5v14M5 12h14"/></svg>;
    case 'trash':
      return <svg {...props}><path d="M5 7h14M9 7V5h6v2M7 7v13h10V7"/></svg>;
    case 'connect':
      return <svg {...props}><circle cx="6" cy="12" r="2.5"/><circle cx="18" cy="6" r="2.5"/><circle cx="18" cy="18" r="2.5"/><path d="M8.2 11 16 6.8M8.2 13l7.8 4.2"/></svg>;
    case 'related':
      return <svg {...props}><path d="M5 12h6M13 12h6M11 8l4 8M9 16l6-8"/></svg>;
    case 'source':
      return <svg {...props}><path d="M5 4h11l3 3v13H5z"/><path d="M14 4v4h5"/><path d="M8 12h8M8 16h6"/></svg>;
    case 'list':
      return <svg {...props}><path d="M4 6h16M4 12h16M4 18h10"/></svg>;
    case 'compass':
      return <svg {...props}><circle cx="12" cy="12" r="9"/><path d="m15 9-2 6-4 1 1-4z"/></svg>;
    case 'book':
      return <svg {...props}><path d="M5 4h11a3 3 0 0 1 3 3v13H8a3 3 0 0 1-3-3z"/><path d="M5 17a3 3 0 0 1 3-3h11"/></svg>;
    case 'graph':
      return <svg {...props}><circle cx="6" cy="18" r="2"/><circle cx="12" cy="6" r="2"/><circle cx="18" cy="14" r="2"/><path d="m7.4 16.5 3.4-8.7M13.6 7.4l3.1 5.4"/></svg>;
    case 'globe':
      return <svg {...props}><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3a14 14 0 0 1 0 18M12 3a14 14 0 0 0 0 18"/></svg>;
    case 'translate':
      return <svg {...props}><path d="M4 5h8M8 4v3M4 11s2 5 7 5M11 6s-1 7-7 9"/><path d="M13 19l4-9 4 9M14.5 16h5"/></svg>;
    case 'settings':
      return <svg {...props}><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3 1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8 1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z"/></svg>;
    default:
      return null;
  }
};
