Almaatla commited on
Commit
4cf70f7
·
verified ·
1 Parent(s): d6224cb

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +20 -10
index.html CHANGED
@@ -44,19 +44,29 @@
44
  const Lucide = window.lucide;
45
 
46
  const Icon = ({ name, size = 16, className = "" }) => {
47
- if (!Lucide || !Lucide.createElement) return <span />;
48
- // lucide creates an SVG DOM node; wrap it for React via dangerouslySetInnerHTML
49
- const el = Lucide.createElement(name, { width: size, height: size, class: className });
 
 
 
 
 
 
 
 
 
50
  return <span dangerouslySetInnerHTML={{ __html: el.outerHTML }} />;
51
  };
52
 
53
- // Drop-in replacements
54
- const Activity = (p) => <Icon name="activity" {...p} />;
55
- const Trophy = (p) => <Icon name="trophy" {...p} />;
56
- const MousePointer = (p) => <Icon name="mouse-pointer" {...p} />;
57
- const Pencil = (p) => <Icon name="pencil" {...p} />;
58
- const Minus = (p) => <Icon name="minus" {...p} />;
59
- const Trash2 = (p) => <Icon name="trash-2" {...p} />;
 
60
 
61
  // --- CONSTANTS ---
62
  const INITIAL_CASH = 10000;
 
44
  const Lucide = window.lucide;
45
 
46
  const Icon = ({ name, size = 16, className = "" }) => {
47
+ if (!Lucide || !Lucide.createElement || !Lucide.icons) return <span />;
48
+
49
+ // lucide icons keys are PascalCase in the bundle (e.g., "Activity", "MousePointer")
50
+ const iconNode = Lucide.icons[name];
51
+ if (!iconNode) return <span />;
52
+
53
+ const el = Lucide.createElement(iconNode, {
54
+ width: size,
55
+ height: size,
56
+ class: className
57
+ });
58
+
59
  return <span dangerouslySetInnerHTML={{ __html: el.outerHTML }} />;
60
  };
61
 
62
+ // Use PascalCase names here:
63
+ const Activity = (p) => <Icon name="Activity" {...p} />;
64
+ const Trophy = (p) => <Icon name="Trophy" {...p} />;
65
+ const MousePointer = (p) => <Icon name="MousePointer" {...p} />;
66
+ const Pencil = (p) => <Icon name="Pencil" {...p} />;
67
+ const Minus = (p) => <Icon name="Minus" {...p} />;
68
+ const Trash2 = (p) => <Icon name="Trash2" {...p} />;
69
+
70
 
71
  // --- CONSTANTS ---
72
  const INITIAL_CASH = 10000;