// Icon.jsx — thin line icons, stroke inherits currentColor
const Icon = ({ name, size = 16, className = '', style = {} }) => {
  const common = { width: size, height: size, viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: 1.5, strokeLinecap: 'round', strokeLinejoin: 'round', className, style };
  const icons = {
    calendar: (<svg {...common}><path d="M8 2V5M16 2V5M3.5 9.09H20.5M3 8.5C3 7.4 3.9 6.5 5 6.5H19C20.1 6.5 21 7.4 21 8.5V19C21 20.1 20.1 21 19 21H5C3.9 21 3 20.1 3 19V8.5Z"/><circle cx="12" cy="14" r="1" fill="currentColor" stroke="none"/><circle cx="17" cy="14" r="1" fill="currentColor" stroke="none"/><circle cx="7" cy="14" r="1" fill="currentColor" stroke="none"/></svg>),
    pin: (<svg {...common}><path d="M12 22C16 18 20 14.4183 20 10C20 5.58172 16.4183 2 12 2C7.58172 2 4 5.58172 4 10C4 14.4183 8 18 12 22Z"/><circle cx="12" cy="10" r="3"/></svg>),
    person: (<svg {...common}><circle cx="12" cy="7" r="4"/><path d="M6 21v-2a4 4 0 014-4h4a4 4 0 014 4v2"/></svg>),
    arrow: (<svg {...common}><path d="M5 12h14M13 5l7 7-7 7"/></svg>),
    clock: (<svg {...common}><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>),
    close: (<svg {...common}><path d="M18 6L6 18M6 6l12 12"/></svg>),
    external: (<svg {...common}><path d="M7 17L17 7M7 7h10v10"/></svg>),
    matrix: (<svg {...common} fill="currentColor" stroke="none"><path d="M.632.55v22.9H2.28V24H0V0h2.28v.55zM19.254 3.037h1.737v4.078h2.265v1.315h-2.265v4.886c0 .593.11 1.027.328 1.3.218.273.578.41 1.08.41.187 0 .36-.015.516-.043.187-.043.372-.11.554-.2v1.407c-.2.063-.44.12-.719.164-.27.053-.54.074-.83.074-.915 0-1.607-.26-2.076-.783-.47-.524-.704-1.325-.704-2.413V8.451h-2.033V7.136h2.033V3.057h.114zm3.733 18.613H21.56l.055-.437 1.365-.547v-12.96l-1.365-.547-.055-.436h4.262v14.927zM7.675 7.81v1.157h.033a3.312 3.312 0 011.117-1.024c.433-.245.936-.365 1.5-.365.998 0 1.763.305 2.297.914.534.61.8 1.49.8 2.647v5.553h-1.733v-5.076c0-.75-.152-1.314-.456-1.686-.305-.372-.736-.558-1.29-.558-.662 0-1.18.285-1.552.856-.372.57-.558 1.35-.558 2.34v4.126H5.941V7.81z"/></svg>),
    meetup: (<svg {...common} fill="currentColor" stroke="none"><path d="M19.24 12.03c-.23-.82.04-1.5.31-2.23l-1.13-1.23c-1.5.58-2.03-.18-2.03-.18-.39-.39-.77-1.44-.77-1.44-.55-.93-1.3-1.29-1.67-1.29h-1.31c-.44.94-1.69 3.27-3.39 4.07-1.41.66-2.37 1.5-2.37 3.57 0 1.18-1.13 1.72-1.6 2.53-.48.82 1.21 2.58 1.92 2.99.74.43 2.2.84 2.2.84.44.24.89.36 1.33.36.89 0 1.68-.37 2.25-1.08.58-.71.92-1.66.92-2.69 0-.79-.27-1.53-.74-2.2 1.38-.91 2.28.33 2.28.33.33-.71 1.94-.47 1.94-.47 1.57 1.03 4.36.74 4.36.74 1.14 3.27-2.5 4.38-2.5 4.38z"/></svg>),
    github: (<svg {...common} fill="currentColor" stroke="none"><path d="M12 2C6.477 2 2 6.477 2 12c0 4.42 2.865 8.166 6.839 9.489.5.092.682-.217.682-.482 0-.237-.008-.866-.013-1.7-2.782.603-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.462-1.11-1.462-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.269 2.75 1.025A9.578 9.578 0 0112 6.836c.85.004 1.705.114 2.504.336 1.909-1.294 2.747-1.025 2.747-1.025.546 1.377.203 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.578.688.48C19.138 20.162 22 16.418 22 12c0-5.523-4.477-10-10-10z"/></svg>),
    heart: (<svg {...common}><path d="M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z"/></svg>),
  };
  return icons[name] || null;
};

window.Icon = Icon;
