// Lucide icon helper shared across the kit (exported to window).
function Icon({ name, size = 20, strokeWidth = 2, style = {} }) {
  const ref = React.useRef(null);
  React.useEffect(() => {
    const el = ref.current;
    if (el && window.lucide && window.lucide[name]) {
      el.innerHTML = '';
      const node = window.lucide.createElement(window.lucide[name]);
      node.setAttribute('width', size);
      node.setAttribute('height', size);
      node.setAttribute('stroke-width', strokeWidth);
      el.appendChild(node);
    }
  }, [name, size, strokeWidth]);
  return <span ref={ref} style={{ display: 'inline-flex', alignItems: 'center', justifyContent: 'center', ...style }} />;
}
window.Icon = Icon;
