@decido/shell 1.0.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. package/README.md +31 -0
  2. package/package.json +17 -14
  3. package/.turbo/turbo-build.log +0 -13
  4. package/src/AgentPlayer.tsx +0 -105
  5. package/src/DecidoPlayer.tsx +0 -117
  6. package/src/bridge/BridgeAgent.ts +0 -443
  7. package/src/components/DecidoIcon.tsx +0 -56
  8. package/src/components/JsonTreeEditor.tsx +0 -117
  9. package/src/components/PanelSplitter.tsx +0 -71
  10. package/src/components/PluginErrorBoundary.tsx +0 -69
  11. package/src/components/SafeLiquidUI.tsx +0 -114
  12. package/src/components/TransientLayer.tsx +0 -92
  13. package/src/components/agent/AgentChat.tsx +0 -134
  14. package/src/components/chat-extensions/IntentCatalogPanel.tsx +0 -81
  15. package/src/components/chat-extensions/chatSlashCommands.ts +0 -101
  16. package/src/components/controls/CreatorInputBar.tsx +0 -144
  17. package/src/components/controls/OSToolbar.tsx +0 -90
  18. package/src/components/controls/TimelineTape.tsx +0 -43
  19. package/src/components/debug/ActionTimelineTab.tsx +0 -111
  20. package/src/components/debug/CSSInspectorTab.tsx +0 -436
  21. package/src/components/debug/ExportTab.tsx +0 -192
  22. package/src/components/debug/FlowHealthTab.tsx +0 -86
  23. package/src/components/debug/LogsTab.tsx +0 -110
  24. package/src/components/debug/MorphStackTab.tsx +0 -241
  25. package/src/components/debug/NetworkTab.tsx +0 -173
  26. package/src/components/debug/PerformanceTab.tsx +0 -171
  27. package/src/components/debug/ProfilesTab.tsx +0 -238
  28. package/src/components/debug/ReplayTab.tsx +0 -70
  29. package/src/components/debug/StoresTab.tsx +0 -255
  30. package/src/components/debug/TopologyTab.tsx +0 -59
  31. package/src/components/debug/debugConfig.tsx +0 -66
  32. package/src/components/playground/DebugPanel.tsx +0 -112
  33. package/src/components/playground/HeaderCenterControls.tsx +0 -92
  34. package/src/components/playground/KeyframeListItem.tsx +0 -70
  35. package/src/components/playground/PlaygroundAppSidebar.tsx +0 -171
  36. package/src/components/playground/PlaygroundBottomControls.tsx +0 -132
  37. package/src/components/playground/PlaygroundCanvas.tsx +0 -87
  38. package/src/components/playground/PlaygroundChat.tsx +0 -236
  39. package/src/components/playground/PlaygroundErrorBoundary.tsx +0 -63
  40. package/src/components/playground/PlaygroundFloatingInput.tsx +0 -352
  41. package/src/components/playground/PlaygroundHeader.tsx +0 -222
  42. package/src/components/playground/PlaygroundSidebar.tsx +0 -136
  43. package/src/components/playground/PlaygroundTerminal.tsx +0 -44
  44. package/src/components/playground/SuggestionCards.tsx +0 -29
  45. package/src/components/playground/demos/ClinicaAINode.tsx +0 -221
  46. package/src/components/playground/demos/FinanceAINode.tsx +0 -226
  47. package/src/components/playground/demos/KiaAcademyNode.tsx +0 -250
  48. package/src/components/playground/demos/KiaBotNode.tsx +0 -207
  49. package/src/components/playground/demos/KiaCampaignNode.tsx +0 -191
  50. package/src/components/playground/demos/KiaComplianceNode.tsx +0 -140
  51. package/src/components/playground/demos/KiaCustomerJourneyNode.tsx +0 -220
  52. package/src/components/playground/demos/KiaCyberNode.tsx +0 -203
  53. package/src/components/playground/demos/KiaDashboardNode.tsx +0 -399
  54. package/src/components/playground/demos/KiaEmbudoOverviewNode.tsx +0 -168
  55. package/src/components/playground/demos/KiaExecutiveNode.tsx +0 -169
  56. package/src/components/playground/demos/KiaGamificationNode.tsx +0 -229
  57. package/src/components/playground/demos/KiaIntelligenceHubNode.tsx +0 -165
  58. package/src/components/playground/demos/KiaInventoryNode.tsx +0 -183
  59. package/src/components/playground/demos/KiaLeadScoringNode.tsx +0 -226
  60. package/src/components/playground/demos/KiaLiveSimulationNode.tsx +0 -177
  61. package/src/components/playground/demos/KiaMultiDealerNode.tsx +0 -223
  62. package/src/components/playground/demos/KiaNPSVoiceNode.tsx +0 -214
  63. package/src/components/playground/demos/KiaOmnichannelNode.tsx +0 -162
  64. package/src/components/playground/demos/KiaPBIBudgetNode.tsx +0 -152
  65. package/src/components/playground/demos/KiaPBIConversionNode.tsx +0 -206
  66. package/src/components/playground/demos/KiaPBIFunnelNode.tsx +0 -184
  67. package/src/components/playground/demos/KiaPBIOwnershipNode.tsx +0 -113
  68. package/src/components/playground/demos/KiaPBIPartnerNode.tsx +0 -143
  69. package/src/components/playground/demos/KiaPBIPreciosNode.tsx +0 -120
  70. package/src/components/playground/demos/KiaPBIRuntNode.tsx +0 -205
  71. package/src/components/playground/demos/KiaPartnerScoreNode.tsx +0 -206
  72. package/src/components/playground/demos/KiaPredictiveNode.tsx +0 -226
  73. package/src/components/playground/demos/KiaShowroomNode.tsx +0 -194
  74. package/src/components/playground/demos/KiaStoreNode.tsx +0 -215
  75. package/src/components/playground/demos/KiaSustainabilityNode.tsx +0 -173
  76. package/src/components/playground/demos/KiaUsedVehiclesNode.tsx +0 -163
  77. package/src/components/playground/demos/KiaWorkshopNode.tsx +0 -221
  78. package/src/components/playground/demos/SmartCityNode.tsx +0 -205
  79. package/src/components/playground/demos/kia_campaign_manifest.json +0 -112
  80. package/src/components/playground/input-parts/AIModelSelector.tsx +0 -156
  81. package/src/components/playground/input-parts/InputActions.tsx +0 -80
  82. package/src/components/playground/input-parts/InputToolbar.tsx +0 -245
  83. package/src/components/playground/input-parts/ResourceLibraryPanel.tsx +0 -287
  84. package/src/components/playground/sidebarDsdIO.ts +0 -82
  85. package/src/components/settings/SettingsPanel.tsx +0 -267
  86. package/src/components/shell/AppHeader.tsx +0 -9
  87. package/src/components/shell/AppShell.tsx +0 -139
  88. package/src/components/shell/ArtifactBar.tsx +0 -97
  89. package/src/components/shell/BootScreen.tsx +0 -19
  90. package/src/components/shell/CenterComposite.tsx +0 -87
  91. package/src/components/shell/CodeEditorPanel.tsx +0 -88
  92. package/src/components/shell/GlobalOverlays.tsx +0 -228
  93. package/src/components/shell/LayoutConfigurator.tsx +0 -209
  94. package/src/components/shell/LayoutGrid.tsx +0 -178
  95. package/src/components/shell/MorphShell.tsx +0 -368
  96. package/src/components/shell/PluginViewer.tsx +0 -147
  97. package/src/components/shell/ShellNexusPreview.tsx +0 -458
  98. package/src/components/shell/SlotRenderer.tsx +0 -115
  99. package/src/components/shell/TabBar.tsx +0 -94
  100. package/src/components/shell/TemplateLibrary.tsx +0 -195
  101. package/src/components/shell/layoutConstants.ts +0 -35
  102. package/src/components/shell/morphStageMeta.ts +0 -15
  103. package/src/components/shell/shells/BuiltInShells.tsx +0 -443
  104. package/src/components/shell/shells/DatawayChatShell.tsx +0 -42
  105. package/src/components/shell/shells/TokenPreview.tsx +0 -339
  106. package/src/components/shell/shells/bootShells.ts +0 -31
  107. package/src/components/shells/CreatorShell.tsx +0 -37
  108. package/src/components/shells/DecidoShell.tsx +0 -447
  109. package/src/components/shells/ExperimentalChatShell.tsx +0 -245
  110. package/src/components/shells/UserCanvas.tsx +0 -44
  111. package/src/components/studio/BlueprintManagerPanel.tsx +0 -137
  112. package/src/components/studio/DependencyTreePanel.tsx +0 -192
  113. package/src/components/studio/NodePalette.tsx +0 -92
  114. package/src/components/studio/NodePropertiesPanel.tsx +0 -81
  115. package/src/components/studio/ReactFlowEditor.tsx +0 -242
  116. package/src/components/studio/TimelineEditor.tsx +0 -122
  117. package/src/components/studio/TimelineKeyframeCard.tsx +0 -99
  118. package/src/components/studio/VariablePanel.tsx +0 -181
  119. package/src/components/studio/blueprint/BlueprintCard.tsx +0 -82
  120. package/src/components/studio/editor/CanvasContextMenu.tsx +0 -107
  121. package/src/components/studio/editor/EditorToolbar.tsx +0 -80
  122. package/src/components/studio/editor/StageContentRenderer.tsx +0 -134
  123. package/src/components/studio/editor/TrackPropertyEditors.tsx +0 -133
  124. package/src/components/studio/editor/TreeNodeItem.tsx +0 -91
  125. package/src/components/studio/editor/edgeStyles.ts +0 -43
  126. package/src/components/studio/editor/editorKeyHandler.ts +0 -95
  127. package/src/components/studio/editor/nodeTypeRegistry.ts +0 -137
  128. package/src/components/studio/editor/paletteCatalog.tsx +0 -84
  129. package/src/components/studio/nodes/shell/InteractionNodes.tsx +0 -82
  130. package/src/components/studio/nodes/shell/LayoutControlNodes.tsx +0 -69
  131. package/src/components/studio/nodes/shell/RegisterActionNode.tsx +0 -20
  132. package/src/components/studio/nodes/shell/RegisterButtonNode.tsx +0 -22
  133. package/src/components/studio/nodes/shell/RegisterPanelNode.tsx +0 -19
  134. package/src/components/studio/nodes/shell/RegisterSidebarNode.tsx +0 -19
  135. package/src/components/studio/nodes/shell/RegisterStatusBarNode.tsx +0 -22
  136. package/src/components/studio/nodes/shell/RegisterTabNode.tsx +0 -21
  137. package/src/components/studio/nodes/shell/RegisterTopBarNode.tsx +0 -22
  138. package/src/components/studio/nodes/shell/ShellConfigNode.tsx +0 -51
  139. package/src/components/studio/nodes/shell/ShellNodeBase.tsx +0 -100
  140. package/src/components/studio/nodes/shell/ThemeNodes.tsx +0 -51
  141. package/src/components/studio/nodes/shell/index.ts +0 -12
  142. package/src/components/widgets/BroadcastWidget.tsx +0 -93
  143. package/src/components/widgets/MarketplaceWidget.tsx +0 -298
  144. package/src/components/widgets/McpToolsWidget.tsx +0 -231
  145. package/src/components/widgets/OpsDashboard.tsx +0 -59
  146. package/src/components/widgets/QuickActionsWidget.tsx +0 -60
  147. package/src/components/widgets/UsageWidget.tsx +0 -112
  148. package/src/components/widgets/WidgetRenderer.tsx +0 -892
  149. package/src/components/widgets/WidgetSlotPanel.tsx +0 -213
  150. package/src/config/IconRegistry.ts +0 -126
  151. package/src/contexts/NetworkProvider.tsx +0 -162
  152. package/src/core/AIDirector.ts +0 -71
  153. package/src/core/EventBus.ts +0 -37
  154. package/src/core/PluginContext.tsx +0 -141
  155. package/src/hooks/listeners/useUIStateListener.ts +0 -59
  156. package/src/hooks/listeners/useWhatsAppListener.ts +0 -110
  157. package/src/hooks/morphBridge.ts +0 -82
  158. package/src/hooks/useAIModelSelector.ts +0 -144
  159. package/src/hooks/useAgentStream.ts +0 -220
  160. package/src/hooks/useAutoUpdater.ts +0 -89
  161. package/src/hooks/useBootSequence.ts +0 -20
  162. package/src/hooks/useExportDSD.ts +0 -53
  163. package/src/hooks/useFullscreen.ts +0 -35
  164. package/src/hooks/useGeminiStream.ts +0 -282
  165. package/src/hooks/useIntentLens.ts +0 -224
  166. package/src/hooks/useKeyboardShortcuts.ts +0 -69
  167. package/src/hooks/useLoggerBridge.ts +0 -32
  168. package/src/hooks/useMcpClient.ts +0 -112
  169. package/src/hooks/useNexusaiDeploy.ts +0 -118
  170. package/src/hooks/usePlaybackEngine.ts +0 -21
  171. package/src/hooks/usePlaygroundCommander.ts +0 -475
  172. package/src/hooks/usePluginEngine.ts +0 -165
  173. package/src/hooks/useScreenRecorder.ts +0 -73
  174. package/src/hooks/useShellKeyboard.ts +0 -40
  175. package/src/hooks/useShellShortcuts.ts +0 -118
  176. package/src/hooks/useSoundEffects.ts +0 -35
  177. package/src/hooks/useStudioConfig.ts +0 -72
  178. package/src/hooks/useSystemBoot.ts +0 -84
  179. package/src/hooks/useSystemTelemetry.ts +0 -62
  180. package/src/lib/debugLogger.ts +0 -80
  181. package/src/lib/networkInterceptor.ts +0 -100
  182. package/src/mocks/decido.tsx +0 -41
  183. package/src/plugins/pluginAPI.ts +0 -190
  184. package/src/store/McpStore.ts +0 -69
  185. package/src/store/UpdaterStore.ts +0 -60
  186. package/src/store/engine.ts +0 -392
  187. package/src/store/index.ts +0 -4
  188. package/src/store/layoutPresets.ts +0 -66
  189. package/src/store/playgroundTypes.ts +0 -98
  190. package/src/store/useActionTimelineStore.ts +0 -48
  191. package/src/store/useDebugPanelStore.ts +0 -98
  192. package/src/store/useDebugProfileStore.ts +0 -130
  193. package/src/store/useLayoutStore.ts +0 -205
  194. package/src/store/useMorphInstanceStore.ts +0 -289
  195. package/src/store/useMorphologyStore.ts +0 -103
  196. package/src/store/usePlaygroundStore.ts +0 -236
  197. package/src/store/useShellRegistry.ts +0 -123
  198. package/src/store/useSuggestionsStore.ts +0 -57
  199. package/src/store/useThemeStore.ts +0 -399
  200. package/src/store/useUIComponentStore.ts +0 -179
  201. package/src/types/DecidoStoryDefinition.ts +0 -43
  202. package/src/utils/ai/ai-architect.ts +0 -92
  203. package/src/utils/ai/ai-code.ts +0 -187
  204. package/src/utils/ai/ai-core.ts +0 -50
  205. package/src/utils/ai/ai-media.ts +0 -292
  206. package/src/utils/layoutGraph.ts +0 -67
  207. package/tsconfig.json +0 -17
  208. package/tsconfig.tsbuildinfo +0 -1
@@ -1,177 +0,0 @@
1
- import React, { useState, useEffect, useCallback } from 'react';
2
- import { BaseNode } from '@decido/macia-core';
3
- import {
4
- Play, Pause, SkipForward, Activity, Zap, Users,
5
- Car, ShoppingCart, Wrench, BarChart3, Radio, TrendingUp,
6
- ArrowRight, Clock, Gauge, RefreshCw
7
- } from 'lucide-react';
8
-
9
- /* ═══════════════════════════════════════════════════════════════
10
- KIA LIVE SIMULATION NODE — Real-Time Data Flow · Grecco Motors
11
- Orchestrates simulated events across all ecosystem nodes
12
- ═══════════════════════════════════════════════════════════════ */
13
-
14
- interface SimEvent {
15
- id: number;
16
- time: string;
17
- source: string;
18
- target: string;
19
- type: 'lead' | 'service' | 'sale' | 'alert' | 'finance';
20
- msg: string;
21
- color: string;
22
- }
23
-
24
- const EVENT_TEMPLATES = [
25
- { source: '📱 WhatsApp Bot', target: '🎯 Lead Scoring', type: 'lead' as const, msg: 'Nuevo lead: María Gómez — Interesada en EV6', color: '#3b82f6' },
26
- { source: '🎯 Lead Scoring', target: '📊 Dashboard', type: 'lead' as const, msg: 'Lead HOT → Assign Johan S. Blanco (Score: 92)', color: '#ef4444' },
27
- { source: '🎮 Gamification', target: '📊 Dashboard', type: 'lead' as const, msg: 'Lucky Drive win: Mantenimiento Gratis → CRM reg', color: '#a855f7' },
28
- { source: '🔧 Workshop', target: '📊 Dashboard', type: 'service' as const, msg: 'Sportage KIA-5502 — Bahía 3 — QC Passed ✅', color: '#22c55e' },
29
- { source: '🏥 Fleet Health', target: '🔧 Workshop', type: 'alert' as const, msg: 'EV6-001: Bujía cilindro 1 desgaste 87% — Cita auto', color: '#f59e0b' },
30
- { source: '🛒 Store', target: '💰 Finance', type: 'sale' as const, msg: 'Pedido #1247: Polarizado 3M + Tapetes — $1.13M', color: '#06b6d4' },
31
- { source: '💰 Finance', target: '📊 Dashboard', type: 'finance' as const, msg: 'Pre-aprobación OK: Score 812, Bancolombia, $112M', color: '#22c55e' },
32
- { source: '🛡️ CyberOps', target: '📊 Dashboard', type: 'alert' as const, msg: 'Brute force blocked — IP 45.33.X.X — WAF active', color: '#ef4444' },
33
- { source: '🚗 Mobility', target: '🛡️ CyberOps', type: 'alert' as const, msg: 'V2X integrity check passed — EV6 fleet OK', color: '#22c55e' },
34
- { source: '📚 Academy', target: '📊 Dashboard', type: 'lead' as const, msg: 'Camila Torres → ADAS Expert cert completed 🏆', color: '#a855f7' },
35
- { source: '🔧 Workshop', target: '🛒 Store', type: 'service' as const, msg: 'Auto-order: Filtro aceite Sportage × 12 unid', color: '#06b6d4' },
36
- { source: '📱 WhatsApp Bot', target: '🎮 Gamification', type: 'lead' as const, msg: 'Redirect: Cliente quiere Test Drive → Showroom', color: '#3b82f6' },
37
- ];
38
-
39
- const PIPELINE_STAGES = [
40
- { label: 'Leads', icon: Users, count: 437, color: '#3b82f6' },
41
- { label: 'Contacto', icon: Radio, count: 246, color: '#06b6d4' },
42
- { label: 'Show Up', icon: Car, count: 85, color: '#a855f7' },
43
- { label: 'Cotización', icon: BarChart3, count: 47, color: '#f59e0b' },
44
- { label: 'Cierre', icon: TrendingUp, count: 30, color: '#22c55e' },
45
- ];
46
-
47
- export const KiaLiveSimulationNode = (props: any) => {
48
- const [events, setEvents] = useState<SimEvent[]>([]);
49
- const [isRunning, setIsRunning] = useState(true);
50
- const [speed, setSpeed] = useState(1);
51
- const [stats, setStats] = useState({ eventsTotal: 0, leads: 0, services: 0, sales: 0, alerts: 0 });
52
- const [pipeline, setPipeline] = useState(PIPELINE_STAGES.map(s => ({ ...s })));
53
-
54
- const addEvent = useCallback(() => {
55
- const template = EVENT_TEMPLATES[Math.floor(Math.random() * EVENT_TEMPLATES.length)];
56
- const ev: SimEvent = {
57
- id: Date.now() + Math.random(),
58
- time: new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', second: '2-digit' }),
59
- ...template,
60
- };
61
- setEvents(prev => [ev, ...prev].slice(0, 50));
62
- setStats(prev => ({
63
- eventsTotal: prev.eventsTotal + 1,
64
- leads: prev.leads + (template.type === 'lead' ? 1 : 0),
65
- services: prev.services + (template.type === 'service' ? 1 : 0),
66
- sales: prev.sales + (template.type === 'sale' ? 1 : 0),
67
- alerts: prev.alerts + (template.type === 'alert' ? 1 : 0),
68
- }));
69
- // Pipeline jitter
70
- setPipeline(prev => prev.map((s, i) => ({
71
- ...s,
72
- count: s.count + (i === 0 ? Math.floor(Math.random() * 3) : 0),
73
- })));
74
- }, []);
75
-
76
- useEffect(() => {
77
- if (!isRunning) return;
78
- const interval = setInterval(addEvent, 2500 / speed);
79
- return () => clearInterval(interval);
80
- }, [isRunning, speed, addEvent]);
81
-
82
- const toggleSpeed = () => setSpeed(s => s >= 4 ? 1 : s * 2);
83
-
84
- return (
85
- <BaseNode {...props} title="Kia Live Simulation" width={520} height={620}>
86
- <div className="flex flex-col h-full bg-[#060a12] text-white overflow-hidden">
87
-
88
- {/* Header */}
89
- <div className="flex items-center gap-3 p-3 bg-[#0c1222] border-b border-slate-800">
90
- <div className="w-9 h-9 rounded-full bg-red-600/20 flex items-center justify-center border border-red-500/30">
91
- <span className="text-red-500 font-bold text-[7px] tracking-widest">KIA</span>
92
- </div>
93
- <div className="flex-1">
94
- <div className="text-xs font-bold tracking-wide flex items-center gap-2">
95
- LIVE SIMULATION
96
- {isRunning && <span className="w-1.5 h-1.5 rounded-full bg-green-400 animate-pulse" />}
97
- </div>
98
- <div className="text-[10px] text-slate-400">Grecco Motors · Event Stream · {stats.eventsTotal} eventos</div>
99
- </div>
100
- <div className="flex gap-1">
101
- <button onClick={() => setIsRunning(!isRunning)}
102
- className={`p-1.5 rounded-lg border transition-all ${isRunning
103
- ? 'bg-green-500/20 border-green-500/30 text-green-400'
104
- : 'bg-slate-800 border-slate-700 text-slate-400'}`}>
105
- {isRunning ? <Pause size={12} /> : <Play size={12} />}
106
- </button>
107
- <button onClick={toggleSpeed}
108
- className="px-2 py-1 rounded-lg bg-slate-800 border border-slate-700 text-[10px] font-bold text-slate-300">
109
- {speed}×
110
- </button>
111
- <button onClick={addEvent}
112
- className="p-1.5 rounded-lg bg-slate-800 border border-slate-700 text-slate-400 hover:text-white">
113
- <SkipForward size={12} />
114
- </button>
115
- </div>
116
- </div>
117
-
118
- {/* Stats Bar */}
119
- <div className="flex gap-1 p-2 bg-[#0a0f1a] border-b border-slate-800">
120
- {[
121
- { val: stats.leads, label: 'Leads', color: 'blue' },
122
- { val: stats.services, label: 'Servicios', color: 'green' },
123
- { val: stats.sales, label: 'Ventas', color: 'cyan' },
124
- { val: stats.alerts, label: 'Alertas', color: 'yellow' },
125
- ].map(s => (
126
- <div key={s.label} className={`flex-1 bg-${s.color}-500/5 border border-${s.color}-500/10 rounded p-1.5 text-center`}>
127
- <div className={`text-sm font-bold text-${s.color}-400`}>{s.val}</div>
128
- <div className="text-[8px] text-slate-500">{s.label}</div>
129
- </div>
130
- ))}
131
- </div>
132
-
133
- {/* Pipeline */}
134
- <div className="flex items-center gap-0.5 px-3 py-2 border-b border-slate-800 bg-slate-900/30">
135
- {pipeline.map((stage, i) => (
136
- <React.Fragment key={stage.label}>
137
- <div className="flex-1 text-center">
138
- <div className="text-base font-bold" style={{ color: stage.color }}>{stage.count}</div>
139
- <div className="text-[8px] text-slate-500">{stage.label}</div>
140
- </div>
141
- {i < pipeline.length - 1 && (
142
- <ArrowRight size={10} className="text-slate-600 flex-shrink-0" />
143
- )}
144
- </React.Fragment>
145
- ))}
146
- </div>
147
-
148
- {/* Event Stream */}
149
- <div className="flex-1 overflow-y-auto p-2 space-y-1">
150
- {events.map(ev => (
151
- <div key={ev.id} className="flex items-start gap-2 bg-slate-900/50 rounded-lg p-2 border border-slate-800/50"
152
- style={{ borderLeftColor: ev.color, borderLeftWidth: '2px' }}>
153
- <div className="flex-shrink-0">
154
- <Activity size={10} className="mt-0.5" style={{ color: ev.color }} />
155
- </div>
156
- <div className="flex-1 min-w-0">
157
- <div className="flex items-center gap-2 text-[9px] text-slate-500 mb-0.5">
158
- <span className="font-mono">{ev.time}</span>
159
- <span>{ev.source}</span>
160
- <ArrowRight size={8} />
161
- <span>{ev.target}</span>
162
- </div>
163
- <div className="text-[10px] text-slate-300 leading-relaxed">{ev.msg}</div>
164
- </div>
165
- </div>
166
- ))}
167
- {events.length === 0 && (
168
- <div className="text-slate-600 text-center py-12 text-xs">
169
- <RefreshCw className="mx-auto mb-2 animate-spin" size={16} />
170
- Iniciando simulación...
171
- </div>
172
- )}
173
- </div>
174
- </div>
175
- </BaseNode>
176
- );
177
- };
@@ -1,223 +0,0 @@
1
- import React, { useState, useEffect } from 'react';
2
- import { BaseNode } from '@decido/macia-core';
3
- import {
4
- Building2, TrendingUp, Users, BarChart3, Map,
5
- ChevronUp, ChevronDown, Eye, Crown, Target, Layers
6
- } from 'lucide-react';
7
-
8
- /* ═══════════════════════════════════════════════════════════════
9
- KIA MULTI-DEALER NODE — Multi-Concesionario · Red Metrokia
10
- Benchmark, ranking, regional dashboard, template system
11
- ═══════════════════════════════════════════════════════════════ */
12
-
13
- interface Dealer {
14
- id: string;
15
- name: string;
16
- city: string;
17
- region: string;
18
- score: number;
19
- prevScore: number;
20
- ranking: string;
21
- sales: number;
22
- posventa: number;
23
- nps: number;
24
- ms: number;
25
- color: string;
26
- }
27
-
28
- const DEALERS: Dealer[] = [
29
- { id: 'GRC-GIR', name: 'Grecco Girón', city: 'Girón', region: 'Santander', score: 94, prevScore: 91, ranking: 'S', sales: 41, posventa: 98, nps: 96.1, ms: 15.2, color: '#ef4444' },
30
- { id: 'GRC-VRO', name: 'Grecco V. Rosario', city: 'V. del Rosario', region: 'N. Santander', score: 91, prevScore: 88, ranking: 'S', sales: 27, posventa: 72, nps: 95.3, ms: 12.8, color: '#3b82f6' },
31
- { id: 'GRC-CUC', name: 'Grecco Cúcuta', city: 'Cúcuta', region: 'N. Santander', score: 87, prevScore: 85, ranking: 'S', sales: 9, posventa: 45, nps: 93.8, ms: 8.4, color: '#22c55e' },
32
- { id: 'GRC-BUC', name: 'Grecco Bucaramanga', city: 'Bucaramanga', region: 'Santander', score: 85, prevScore: 82, ranking: 'A', sales: 6, posventa: 38, nps: 94.2, ms: 6.1, color: '#f59e0b' },
33
- { id: 'GRC-PIE', name: 'Grecco Piedecuesta', city: 'Piedecuesta', region: 'Santander', score: 82, prevScore: 79, ranking: 'A', sales: 8, posventa: 32, nps: 92.0, ms: 5.5, color: '#a855f7' },
34
- { id: 'GRC-FLR', name: 'Grecco Floridablanca', city: 'Floridablanca', region: 'Santander', score: 80, prevScore: 78, ranking: 'A', sales: 4, posventa: 28, nps: 91.5, ms: 4.2, color: '#06b6d4' },
35
- ];
36
-
37
- const REGIONS = ['Nacional', 'Santander', 'N. Santander'];
38
-
39
- const TEMPLATES = [
40
- { name: 'Dashboard Ejecutivo', nodes: 7, slides: 6, uses: 12 },
41
- { name: 'Posventa Predictiva', nodes: 4, slides: 5, uses: 8 },
42
- { name: 'Embudo Comercial', nodes: 5, slides: 6, uses: 15 },
43
- { name: 'Partner Score 360°', nodes: 6, slides: 5, uses: 6 },
44
- ];
45
-
46
- export const KiaMultiDealerNode = (props: any) => {
47
- const [tab, setTab] = useState<'overview' | 'benchmark' | 'templates'>('overview');
48
- const [region, setRegion] = useState('Nacional');
49
- const [dealers, setDealers] = useState(DEALERS.map(d => ({ ...d })));
50
-
51
- const filtered = region === 'Nacional' ? dealers : dealers.filter(d => d.region === region);
52
- const totalSales = filtered.reduce((s, d) => s + d.sales, 0);
53
- const avgNPS = (filtered.reduce((s, d) => s + d.nps, 0) / filtered.length).toFixed(1);
54
- const avgScore = Math.round(filtered.reduce((s, d) => s + d.score, 0) / filtered.length);
55
-
56
- // Subtle jitter
57
- useEffect(() => {
58
- const interval = setInterval(() => {
59
- setDealers(prev => prev.map(d => ({
60
- ...d,
61
- sales: d.sales + Math.floor(Math.random() * 3 - 1),
62
- score: Math.min(99, Math.max(60, d.score + Math.floor(Math.random() * 3 - 1))),
63
- nps: Math.min(99, Math.max(70, parseFloat((d.nps + (Math.random() - 0.5)).toFixed(1)))),
64
- })));
65
- }, 7000);
66
- return () => clearInterval(interval);
67
- }, []);
68
-
69
- return (
70
- <BaseNode {...props} title="Kia Multi-Dealer" width={520} height={620}>
71
- <div className="flex flex-col h-full bg-[#060a12] text-white overflow-hidden">
72
-
73
- {/* Header */}
74
- <div className="flex items-center gap-3 p-3 bg-[#0c1222] border-b border-slate-800">
75
- <div className="w-9 h-9 rounded-full bg-red-600/20 flex items-center justify-center border border-red-500/30">
76
- <Building2 size={16} className="text-red-400" />
77
- </div>
78
- <div className="flex-1">
79
- <div className="text-xs font-bold tracking-wide flex items-center gap-2">
80
- RED METROKIA
81
- <span className="text-[8px] px-1.5 py-0.5 bg-blue-500/20 text-blue-400 rounded font-normal">{DEALERS.length} SEDES</span>
82
- </div>
83
- <div className="text-[10px] text-slate-400">Multi-Concesionario · Benchmark · {totalSales} ventas/mes</div>
84
- </div>
85
- <select value={region} onChange={e => setRegion(e.target.value)}
86
- className="bg-slate-800 border border-slate-700 rounded-lg px-2 py-1 text-[10px] text-slate-300 focus:outline-none">
87
- {REGIONS.map(r => <option key={r} value={r}>{r}</option>)}
88
- </select>
89
- </div>
90
-
91
- {/* Tabs */}
92
- <div className="flex gap-1 p-2 bg-[#0a0f1a] border-b border-slate-800">
93
- {([
94
- { key: 'overview' as const, icon: Map, label: 'Regional' },
95
- { key: 'benchmark' as const, icon: BarChart3, label: 'Benchmark' },
96
- { key: 'templates' as const, icon: Layers, label: 'Templates' },
97
- ]).map(t => (
98
- <button key={t.key} onClick={() => setTab(t.key)}
99
- className={`flex-1 flex items-center justify-center gap-1 py-1.5 rounded text-[9px] font-bold transition-all ${tab === t.key ? 'bg-red-600/20 text-red-400 border border-red-500/30' : 'text-slate-500'
100
- }`}>
101
- <t.icon size={10} /> {t.label}
102
- </button>
103
- ))}
104
- </div>
105
-
106
- {/* Stats Bar */}
107
- <div className="flex gap-1 px-3 py-2 border-b border-slate-800">
108
- {[
109
- { label: 'Ventas/Mes', val: totalSales.toString(), color: 'text-blue-400' },
110
- { label: 'NPS Prom', val: `${avgNPS}%`, color: 'text-green-400' },
111
- { label: 'Score Prom', val: avgScore.toString(), color: 'text-purple-400' },
112
- { label: 'Sedes', val: filtered.length.toString(), color: 'text-slate-400' },
113
- ].map(s => (
114
- <div key={s.label} className="flex-1 text-center bg-slate-900/50 rounded p-1.5 border border-slate-800/50">
115
- <div className={`text-sm font-bold ${s.color}`}>{s.val}</div>
116
- <div className="text-[8px] text-slate-500">{s.label}</div>
117
- </div>
118
- ))}
119
- </div>
120
-
121
- {/* Content */}
122
- <div className="flex-1 overflow-y-auto p-3 space-y-2">
123
-
124
- {/* Overview — Regional Cards */}
125
- {tab === 'overview' && filtered.map((d, i) => (
126
- <div key={d.id} className="bg-slate-900/50 rounded-lg p-3 border border-slate-800"
127
- style={{ borderLeftWidth: '3px', borderLeftColor: d.color }}>
128
- <div className="flex items-center justify-between mb-2">
129
- <div className="flex items-center gap-2">
130
- {i === 0 && <Crown size={12} className="text-yellow-400" />}
131
- <div>
132
- <div className="text-[11px] font-bold">{d.name}</div>
133
- <div className="text-[9px] text-slate-500">{d.city} · {d.region}</div>
134
- </div>
135
- </div>
136
- <div className="flex items-center gap-2">
137
- <div className={`px-2 py-0.5 rounded text-[10px] font-black ${d.ranking === 'S' ? 'bg-green-500/20 text-green-400' :
138
- d.ranking === 'A' ? 'bg-blue-500/20 text-blue-400' :
139
- 'bg-yellow-500/20 text-yellow-400'
140
- }`}>{d.ranking}</div>
141
- <div className="text-right">
142
- <div className="text-sm font-bold">{d.score}</div>
143
- <div className={`text-[8px] flex items-center gap-0.5 ${d.score > d.prevScore ? 'text-green-400' : 'text-red-400'}`}>
144
- {d.score > d.prevScore ? <ChevronUp size={8} /> : <ChevronDown size={8} />}
145
- {Math.abs(d.score - d.prevScore)}
146
- </div>
147
- </div>
148
- </div>
149
- </div>
150
- <div className="flex gap-3 text-[9px]">
151
- <span className="text-slate-400">Ventas: <span className="font-bold text-blue-400">{d.sales}</span></span>
152
- <span className="text-slate-400">Posventa: <span className="font-bold text-green-400">{d.posventa}</span></span>
153
- <span className="text-slate-400">NPS: <span className="font-bold text-purple-400">{d.nps}%</span></span>
154
- <span className="text-slate-400">MS: <span className="font-bold text-yellow-400">{d.ms}%</span></span>
155
- </div>
156
- </div>
157
- ))}
158
-
159
- {/* Benchmark — Comparative Bars */}
160
- {tab === 'benchmark' && (
161
- <>
162
- <div className="text-[9px] text-slate-500 font-bold uppercase mb-1">Benchmark por KPI</div>
163
- {['score', 'sales', 'nps', 'ms'].map(kpi => (
164
- <div key={kpi} className="bg-slate-900/50 rounded-lg p-2.5 border border-slate-800">
165
- <div className="text-[9px] text-slate-400 font-bold uppercase mb-1.5">
166
- {kpi === 'score' ? '⭐ Partner Score' : kpi === 'sales' ? '📊 Ventas/Mes' : kpi === 'nps' ? '💚 NPS' : '📈 Market Share'}
167
- </div>
168
- {filtered.sort((a, b) => {
169
- const val = (d: Dealer) => kpi === 'score' ? d.score : kpi === 'sales' ? d.sales : kpi === 'nps' ? d.nps : d.ms;
170
- return val(b) - val(a);
171
- }).map((d, i) => {
172
- const val = kpi === 'score' ? d.score : kpi === 'sales' ? d.sales : kpi === 'nps' ? d.nps : d.ms;
173
- const max = kpi === 'score' ? 100 : kpi === 'sales' ? 100 : kpi === 'nps' ? 100 : 20;
174
- return (
175
- <div key={d.id} className="flex items-center gap-2 mb-1">
176
- <span className="text-[8px] text-slate-500 w-3 text-right">{i + 1}</span>
177
- <span className="text-[9px] font-semibold w-20 truncate" style={{ color: d.color }}>{d.name.split(' ')[0]}</span>
178
- <div className="flex-1 h-1.5 bg-slate-800 rounded-full">
179
- <div className="h-full rounded-full transition-all duration-700"
180
- style={{ width: `${(val / max) * 100}%`, background: d.color }} />
181
- </div>
182
- <span className="text-[9px] font-bold text-white w-8 text-right">
183
- {kpi === 'nps' || kpi === 'ms' ? `${val}%` : val}
184
- </span>
185
- </div>
186
- );
187
- })}
188
- </div>
189
- ))}
190
- </>
191
- )}
192
-
193
- {/* Templates */}
194
- {tab === 'templates' && (
195
- <>
196
- <div className="text-[9px] text-slate-500 font-bold uppercase mb-1 flex items-center gap-1">
197
- <Layers size={10} /> Templates Exportables
198
- </div>
199
- {TEMPLATES.map(t => (
200
- <div key={t.name} className="bg-slate-900/50 rounded-lg p-3 border border-slate-800 flex items-center justify-between">
201
- <div>
202
- <div className="text-[11px] font-bold text-white">{t.name}</div>
203
- <div className="text-[9px] text-slate-500">{t.nodes} nodos · {t.slides} slides · Usado {t.uses}×</div>
204
- </div>
205
- <button className="px-2.5 py-1 bg-red-600/20 border border-red-500/30 rounded-lg text-[9px] font-bold text-red-400 hover:bg-red-600/30 transition-all">
206
- Exportar
207
- </button>
208
- </div>
209
- ))}
210
- <div className="bg-blue-500/5 rounded-lg p-3 border border-blue-500/20 mt-2">
211
- <div className="text-[10px] font-bold text-blue-400 mb-1">🔄 Sincronización</div>
212
- <div className="text-[9px] text-slate-400">
213
- Templates compartidos automáticamente con {DEALERS.length} sedes.
214
- Cada sede puede personalizar datos locales manteniendo la estructura.
215
- </div>
216
- </div>
217
- </>
218
- )}
219
- </div>
220
- </div>
221
- </BaseNode>
222
- );
223
- };
@@ -1,214 +0,0 @@
1
- import React, { useState, useEffect } from 'react';
2
- import { BaseNode } from '@decido/macia-core';
3
- import {
4
- MessageCircle, Star, ThumbsUp, ThumbsDown, TrendingUp,
5
- BarChart3, Heart, AlertCircle, Smile, Frown, Meh
6
- } from 'lucide-react';
7
-
8
- /* ═══════════════════════════════════════════════════════════════
9
- KIA NPS & VOICE NODE — Voice of Customer · Grecco Motors
10
- NPS tracking, sentiment analysis, survey automation, verbatims
11
- ═══════════════════════════════════════════════════════════════ */
12
-
13
- const NPS_HISTORY = [
14
- { month: 'Sep', score: 82, responses: 156 },
15
- { month: 'Oct', score: 85, responses: 178 },
16
- { month: 'Nov', score: 88, responses: 192 },
17
- { month: 'Dic', score: 91, responses: 201 },
18
- { month: 'Ene', score: 93, responses: 215 },
19
- { month: 'Feb', score: 95, responses: 187 },
20
- ];
21
-
22
- const VERBATIMS = [
23
- { name: 'María Gómez', model: 'EV6', rating: 5, text: 'Excelente atención de Johan. El EV6 supera expectativas. ¡100% recomendado!', sentiment: 'positive' as const, date: 'Feb 15' },
24
- { name: 'Carlos Ruiz', model: 'Sportage', rating: 4, text: 'Buen servicio posventa, pero el tiempo de espera fue un poco largo.', sentiment: 'neutral' as const, date: 'Feb 14' },
25
- { name: 'Laura Mejía', model: 'Seltos', rating: 5, text: 'Lucky Drive fue increíble. Gané accesorios gratis. Gran experiencia!', sentiment: 'positive' as const, date: 'Feb 13' },
26
- { name: 'Pedro Martínez', model: 'K3', rating: 2, text: 'Mi reclamación de garantía lleva 3 semanas sin resolver. Muy decepcionado.', sentiment: 'negative' as const, date: 'Feb 12' },
27
- { name: 'Ana Restrepo', model: 'Sorento', rating: 5, text: 'El cargador V2G en Grecco HQ es el mejor de la ciudad. Servicio AAA.', sentiment: 'positive' as const, date: 'Feb 11' },
28
- { name: 'Diego Arias', model: 'Picanto', rating: 3, text: 'El mantenimiento estuvo OK. Faltó comunicación sobre el tiempo estimado.', sentiment: 'neutral' as const, date: 'Feb 10' },
29
- ];
30
-
31
- const CATEGORIES = [
32
- { label: 'Atención Ventas', score: 96, count: 89, trend: 3 },
33
- { label: 'Posventa', score: 88, count: 124, trend: -1 },
34
- { label: 'Experiencia Showroom', score: 94, count: 67, trend: 5 },
35
- { label: 'Financiación', score: 91, count: 45, trend: 2 },
36
- { label: 'Entrega Vehículo', score: 85, count: 38, trend: -2 },
37
- { label: 'Accesorios / Store', score: 92, count: 56, trend: 4 },
38
- ];
39
-
40
- export const KiaNPSVoiceNode = (props: any) => {
41
- const [tab, setTab] = useState<'overview' | 'verbatims' | 'categories'>('overview');
42
- const [history, setHistory] = useState(NPS_HISTORY.map(h => ({ ...h })));
43
-
44
- const currentNPS = history[history.length - 1].score;
45
- const prevNPS = history[history.length - 2].score;
46
- const totalResponses = history.reduce((s, h) => s + h.responses, 0);
47
- const promoters = Math.round(totalResponses * 0.72);
48
- const passives = Math.round(totalResponses * 0.18);
49
- const detractors = Math.round(totalResponses * 0.10);
50
-
51
- // NPS bar chart max
52
- const maxScore = 100;
53
- const barWidth = 100 / history.length;
54
-
55
- // Jitter
56
- useEffect(() => {
57
- const interval = setInterval(() => {
58
- setHistory(prev => prev.map((h, i) =>
59
- i === prev.length - 1
60
- ? { ...h, score: Math.min(99, Math.max(80, h.score + Math.floor(Math.random() * 3 - 1))), responses: h.responses + Math.floor(Math.random() * 3) }
61
- : h
62
- ));
63
- }, 6000);
64
- return () => clearInterval(interval);
65
- }, []);
66
-
67
- const sentimentIcon = (s: string) =>
68
- s === 'positive' ? <Smile size={12} className="text-green-400" /> :
69
- s === 'negative' ? <Frown size={12} className="text-red-400" /> :
70
- <Meh size={12} className="text-yellow-400" />;
71
-
72
- return (
73
- <BaseNode {...props} title="Kia NPS & Voice" width={480} height={620}>
74
- <div className="flex flex-col h-full bg-slate-950 text-white overflow-hidden">
75
-
76
- {/* Header */}
77
- <div className="flex items-center gap-3 p-3 bg-slate-900 border-b border-slate-800">
78
- <div className="w-9 h-9 rounded-full bg-pink-600/20 flex items-center justify-center border border-pink-500/30">
79
- <Heart size={16} className="text-pink-400" />
80
- </div>
81
- <div className="flex-1">
82
- <div className="text-xs font-bold tracking-wide flex items-center gap-2">
83
- NPS & VOZ DEL CLIENTE
84
- <span className="text-[8px] px-1.5 py-0.5 bg-green-500/20 text-green-400 rounded">{currentNPS} NPS</span>
85
- </div>
86
- <div className="text-[10px] text-slate-400">Grecco Motors · {totalResponses} respuestas · Sentiment AI</div>
87
- </div>
88
- </div>
89
-
90
- {/* Tabs */}
91
- <div className="flex gap-1 p-2 bg-slate-900/50 border-b border-slate-800">
92
- {([
93
- { key: 'overview' as const, label: '📊 NPS' },
94
- { key: 'verbatims' as const, label: '💬 Verbatims' },
95
- { key: 'categories' as const, label: '📋 Categorías' },
96
- ]).map(t => (
97
- <button key={t.key} onClick={() => setTab(t.key)}
98
- className={`flex-1 py-1.5 rounded text-[9px] font-bold transition-all ${tab === t.key ? 'bg-pink-600/20 text-pink-400 border border-pink-500/30' : 'text-slate-500'
99
- }`}>
100
- {t.label}
101
- </button>
102
- ))}
103
- </div>
104
-
105
- {/* Content */}
106
- <div className="flex-1 overflow-y-auto p-3 space-y-3">
107
-
108
- {tab === 'overview' && (
109
- <>
110
- {/* NPS Score */}
111
- <div className="flex items-center gap-4 bg-slate-900/50 rounded-lg p-3 border border-slate-800">
112
- <div className="text-center">
113
- <div className="text-3xl font-black text-green-400">{currentNPS}</div>
114
- <div className="text-[9px] text-slate-500">NPS Score</div>
115
- <div className={`text-[9px] font-bold ${currentNPS >= prevNPS ? 'text-green-400' : 'text-red-400'}`}>
116
- {currentNPS >= prevNPS ? '↑' : '↓'} {Math.abs(currentNPS - prevNPS)} pts
117
- </div>
118
- </div>
119
- <div className="flex-1 space-y-1.5">
120
- <div className="flex items-center gap-2">
121
- <ThumbsUp size={10} className="text-green-400" />
122
- <span className="text-[9px] text-slate-400 w-20">Promotores</span>
123
- <div className="flex-1 h-2 bg-slate-800 rounded-full">
124
- <div className="h-full rounded-full bg-green-500" style={{ width: '72%' }} />
125
- </div>
126
- <span className="text-[9px] font-bold text-green-400">{promoters}</span>
127
- </div>
128
- <div className="flex items-center gap-2">
129
- <Meh size={10} className="text-yellow-400" />
130
- <span className="text-[9px] text-slate-400 w-20">Pasivos</span>
131
- <div className="flex-1 h-2 bg-slate-800 rounded-full">
132
- <div className="h-full rounded-full bg-yellow-500" style={{ width: '18%' }} />
133
- </div>
134
- <span className="text-[9px] font-bold text-yellow-400">{passives}</span>
135
- </div>
136
- <div className="flex items-center gap-2">
137
- <ThumbsDown size={10} className="text-red-400" />
138
- <span className="text-[9px] text-slate-400 w-20">Detractores</span>
139
- <div className="flex-1 h-2 bg-slate-800 rounded-full">
140
- <div className="h-full rounded-full bg-red-500" style={{ width: '10%' }} />
141
- </div>
142
- <span className="text-[9px] font-bold text-red-400">{detractors}</span>
143
- </div>
144
- </div>
145
- </div>
146
-
147
- {/* NPS Trend Chart */}
148
- <div className="bg-slate-900/50 rounded-lg p-3 border border-slate-800">
149
- <div className="text-[9px] text-slate-500 font-bold uppercase mb-2">Tendencia NPS · 6 meses</div>
150
- <svg viewBox="0 0 240 80" className="w-full">
151
- {history.map((h, i) => {
152
- const x = 20 + i * 38;
153
- const barH = (h.score / maxScore) * 55;
154
- return (
155
- <React.Fragment key={h.month}>
156
- <rect x={x} y={65 - barH} width={28} height={barH} rx={3}
157
- fill={h.score >= 90 ? '#22c55e' : h.score >= 80 ? '#3b82f6' : '#f59e0b'}
158
- opacity={0.7} />
159
- <text x={x + 14} y={60 - barH} textAnchor="middle" fontSize="7" fontWeight="700"
160
- fill="white">{h.score}</text>
161
- <text x={x + 14} y={75} textAnchor="middle" fontSize="6" fill="#64748b">{h.month}</text>
162
- </React.Fragment>
163
- );
164
- })}
165
- </svg>
166
- </div>
167
- </>
168
- )}
169
-
170
- {tab === 'verbatims' && VERBATIMS.map((v, i) => (
171
- <div key={i} className="bg-slate-900/50 rounded-lg p-2.5 border border-slate-800"
172
- style={{ borderLeftWidth: '2px', borderLeftColor: v.sentiment === 'positive' ? '#22c55e' : v.sentiment === 'negative' ? '#ef4444' : '#f59e0b' }}>
173
- <div className="flex items-center justify-between mb-1">
174
- <div className="flex items-center gap-1.5">
175
- {sentimentIcon(v.sentiment)}
176
- <span className="text-[10px] font-bold">{v.name}</span>
177
- <span className="text-[8px] text-slate-500">· {v.model}</span>
178
- </div>
179
- <div className="flex items-center gap-1">
180
- {Array.from({ length: 5 }, (_, j) => (
181
- <Star key={j} size={8} className={j < v.rating ? 'text-yellow-400 fill-yellow-400' : 'text-slate-700'} />
182
- ))}
183
- </div>
184
- </div>
185
- <div className="text-[9px] text-slate-300 italic leading-relaxed">"{v.text}"</div>
186
- <div className="text-[8px] text-slate-600 mt-1">{v.date}</div>
187
- </div>
188
- ))}
189
-
190
- {tab === 'categories' && CATEGORIES.map(c => (
191
- <div key={c.label} className="bg-slate-900/50 rounded-lg p-2.5 border border-slate-800">
192
- <div className="flex items-center justify-between mb-1">
193
- <span className="text-[10px] font-bold">{c.label}</span>
194
- <div className="flex items-center gap-2">
195
- <span className={`text-[8px] ${c.trend > 0 ? 'text-green-400' : 'text-red-400'}`}>
196
- {c.trend > 0 ? '↑' : '↓'}{Math.abs(c.trend)}%
197
- </span>
198
- <span className="text-sm font-bold text-green-400">{c.score}</span>
199
- </div>
200
- </div>
201
- <div className="flex items-center gap-2">
202
- <div className="flex-1 h-1.5 bg-slate-800 rounded-full">
203
- <div className="h-full rounded-full bg-linear-to-r from-pink-500 to-green-500 transition-all duration-700"
204
- style={{ width: `${c.score}%` }} />
205
- </div>
206
- <span className="text-[8px] text-slate-500">{c.count} resp</span>
207
- </div>
208
- </div>
209
- ))}
210
- </div>
211
- </div>
212
- </BaseNode>
213
- );
214
- };