FinceptTerminal is a modern finance application offering advanced market analytics, investment research, and economic data tools, designed for interactive exploration and data-driven decision-making in a user-friendly environment.
C++ ai-agentsalgorithmic-tradingbloomberg-terminalcppfinancefinancial-marketsfintechgood-first-issueinvestmentinvestment-researchmachine-learningopensourcepythonqtquantitative-financestock-markettrading
Terminal Files Update mainly UI [skip ci]
tilakpatel226f8790c95ead
diff --git a/fincept-terminal-desktop/src/components/dashboard/DashboardScreen.tsx b/fincept-terminal-desktop/src/components/dashboard/DashboardScreen.tsxindex ca9bb594d..4a492f09a 100644--- a/fincept-terminal-desktop/src/components/dashboard/DashboardScreen.tsx+++ b/fincept-terminal-desktop/src/components/dashboard/DashboardScreen.tsx@@ -8,6 +8,21 @@ import NewsTab from '@/components/tabs/NewsTab';import AdvancedTab from '@/components/tabs/AdvancedTab';import WatchlistTab from '@/components/tabs/WatchlistTab';import GeopoliticsTab from '@/components/tabs/GeopoliticsTab';+import ChatTab from '@/components/tabs/ChatTab';+import ProfileTab from '@/components/tabs/ProfileTab';+import MarketplaceTab from '@/components/tabs/MarketplaceTab';+import PortfolioTab from '@/components/tabs/PortfolioTab';+import AnalyticsTab from '@/components/tabs/AnalyticsTab';+import EquityResearchTab from '@/components/tabs/EquityResearchTab';+import FixedIncomeTab from '@/components/tabs/FixedIncomeTab';+import OptionsTab from '@/components/tabs/OptionsTab';+import EconomicCalendarTab from '@/components/tabs/EconomicCalendarTab';+import ScreenerTab from '@/components/tabs/ScreenerTab';+import AlertsTab from '@/components/tabs/AlertsTab';+import DBnomicsTab from '@/components/tabs/DBnomicsTab';+import CodeEditorTab from '@/components/tabs/CodeEditorTab';+import DocsTab from '@/components/tabs/DocsTab';+import MaritimeTab from '@/components/tabs/MaritimeTab';// Dropdown Menu Componentconst DropdownMenu = ({ label, items, onItemClick }) => {@@ -276,7 +291,9 @@ export default function FinxeptTerminal() {<DropdownMenu label="Tools" items={toolsMenuItems} onItemClick={handleMenuAction} /><DropdownMenu label="Help" items={helpMenuItems} onItemClick={handleMenuAction} /></div>- <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '16px' }}>+ <span style={{ color: '#ea580c', fontSize: '11px', fontWeight: 'bold', letterSpacing: '0.5px' }}>FINCEPT PROFESSIONAL</span>+ <div style={{ width: '1px', height: '14px', backgroundColor: '#525252' }}></div><buttononClick={toggleFullscreen}style={{@@ -377,6 +394,96 @@ export default function FinxeptTerminal() {>Geopolitics</TabsTrigger>+ <TabsTrigger+ value="chat"+ style={activeTab === 'chat' ? tabStyles.active : tabStyles.default}+ >+ AI Chat+ </TabsTrigger>+ <TabsTrigger+ value="profile"+ style={activeTab === 'profile' ? tabStyles.active : tabStyles.default}+ >+ Profile+ </TabsTrigger>+ <TabsTrigger+ value="marketplace"+ style={activeTab === 'marketplace' ? tabStyles.active : tabStyles.default}+ >+ Marketplace+ </TabsTrigger>+ <TabsTrigger+ value="portfolio"+ style={activeTab === 'portfolio' ? tabStyles.active : tabStyles.default}+ >+ Portfolio+ </TabsTrigger>+ <TabsTrigger+ value="analytics"+ style={activeTab === 'analytics' ? tabStyles.active : tabStyles.default}+ >+ Analytics+ </TabsTrigger>+ <TabsTrigger+ value="research"+ style={activeTab === 'research' ? tabStyles.active : tabStyles.default}+ >+ Equity Research+ </TabsTrigger>+ <TabsTrigger+ value="fixedincome"+ style={activeTab === 'fixedincome' ? tabStyles.active : tabStyles.default}+ >+ Fixed Income+ </TabsTrigger>+ <TabsTrigger+ value="options"+ style={activeTab === 'options' ? tabStyles.active : tabStyles.default}+ >+ Options+ </TabsTrigger>+ <TabsTrigger+ value="calendar"+ style={activeTab === 'calendar' ? tabStyles.active : tabStyles.default}+ >+ Economic Calendar+ </TabsTrigger>+ <TabsTrigger+ value="screener"+ style={activeTab === 'screener' ? tabStyles.active : tabStyles.default}+ >+ Screener+ </TabsTrigger>+ <TabsTrigger+ value="alerts"+ style={activeTab === 'alerts' ? tabStyles.active : tabStyles.default}+ >+ Alerts+ </TabsTrigger>+ <TabsTrigger+ value="dbnomics"+ style={activeTab === 'dbnomics' ? tabStyles.active : tabStyles.default}+ >+ DBnomics+ </TabsTrigger>+ <TabsTrigger+ value="code"+ style={activeTab === 'code' ? tabStyles.active : tabStyles.default}+ >+ Code Editor+ </TabsTrigger>+ <TabsTrigger+ value="docs"+ style={activeTab === 'docs' ? tabStyles.active : tabStyles.default}+ >+ Docs+ </TabsTrigger>+ <TabsTrigger+ value="maritime"+ style={activeTab === 'maritime' ? tabStyles.active : tabStyles.default}+ >+ Maritime+ </TabsTrigger></TabsList></Tabs></div>@@ -451,6 +558,51 @@ export default function FinxeptTerminal() {<TabsContent value="geopolitics" className="h-full m-0 p-0"><GeopoliticsTab /></TabsContent>+ <TabsContent value="chat" className="h-full m-0 p-0">+ <ChatTab />+ </TabsContent>+ <TabsContent value="profile" className="h-full m-0 p-0">+ <ProfileTab />+ </TabsContent>+ <TabsContent value="marketplace" className="h-full m-0 p-0">+ <MarketplaceTab />+ </TabsContent>+ <TabsContent value="portfolio" className="h-full m-0 p-0">+ <PortfolioTab />+ </TabsContent>+ <TabsContent value="analytics" className="h-full m-0 p-0">+ <AnalyticsTab />+ </TabsContent>+ <TabsContent value="research" className="h-full m-0 p-0">+ <EquityResearchTab />+ </TabsContent>+ <TabsContent value="fixedincome" className="h-full m-0 p-0">+ <FixedIncomeTab />+ </TabsContent>+ <TabsContent value="options" className="h-full m-0 p-0">+ <OptionsTab />+ </TabsContent>+ <TabsContent value="calendar" className="h-full m-0 p-0">+ <EconomicCalendarTab />+ </TabsContent>+ <TabsContent value="screener" className="h-full m-0 p-0">+ <ScreenerTab />+ </TabsContent>+ <TabsContent value="alerts" className="h-full m-0 p-0">+ <AlertsTab />+ </TabsContent>+ <TabsContent value="dbnomics" className="h-full m-0 p-0">+ <DBnomicsTab />+ </TabsContent>+ <TabsContent value="code" className="h-full m-0 p-0">+ <CodeEditorTab />+ </TabsContent>+ <TabsContent value="docs" className="h-full m-0 p-0">+ <DocsTab />+ </TabsContent>+ <TabsContent value="maritime" className="h-full m-0 p-0">+ <MaritimeTab />+ </TabsContent></Tabs></div></div>diff --git a/fincept-terminal-desktop/src/components/tabs/AlertsTab.tsx b/fincept-terminal-desktop/src/components/tabs/AlertsTab.tsxnew file mode 100644index 000000000..94994885d--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/AlertsTab.tsx@@ -0,0 +1,634 @@+import React, { useState, useEffect } from 'react';++interface Alert {+ id: string;+ type: 'PRICE' | 'VOLUME' | 'INDICATOR' | 'NEWS' | 'EARNING';+ symbol: string;+ condition: string;+ trigger: string;+ status: 'ACTIVE' | 'TRIGGERED' | 'EXPIRED' | 'DISABLED';+ priority: 'HIGH' | 'MEDIUM' | 'LOW';+ created: string;+ lastTriggered?: string;+ triggerCount: number;+}++interface Notification {+ id: string;+ time: string;+ symbol: string;+ type: string;+ message: string;+ priority: 'HIGH' | 'MEDIUM' | 'LOW';+ read: boolean;+}++const AlertsTab: React.FC = () => {+ const [currentTime, setCurrentTime] = useState(new Date());+ const [selectedType, setSelectedType] = useState('ALL');+ const [selectedStatus, setSelectedStatus] = useState('ALL');+ const [showCreateModal, setShowCreateModal] = useState(false);++ const COLOR_ORANGE = '#FFA500';+ const COLOR_WHITE = '#FFFFFF';+ const COLOR_RED = '#FF0000';+ const COLOR_GREEN = '#00C800';+ const COLOR_YELLOW = '#FFFF00';+ const COLOR_GRAY = '#787878';+ const COLOR_BLUE = '#6496FA';+ const COLOR_PURPLE = '#C864FF';+ const COLOR_CYAN = '#00FFFF';+ const COLOR_DARK_BG = '#000000';+ const COLOR_PANEL_BG = '#0a0a0a';++ useEffect(() => {+ const timer = setInterval(() => setCurrentTime(new Date()), 1000);+ return () => clearInterval(timer);+ }, []);++ const alerts: Alert[] = [+ {+ id: 'ALT001',+ type: 'PRICE',+ symbol: 'AAPL',+ condition: 'Price Above',+ trigger: '$180.00',+ status: 'ACTIVE',+ priority: 'HIGH',+ created: '2025-03-10 09:30',+ triggerCount: 0+ },+ {+ id: 'ALT002',+ type: 'PRICE',+ symbol: 'TSLA',+ condition: 'Price Below',+ trigger: '$185.00',+ status: 'TRIGGERED',+ priority: 'HIGH',+ created: '2025-03-12 14:20',+ lastTriggered: '2025-03-15 11:34',+ triggerCount: 3+ },+ {+ id: 'ALT003',+ type: 'VOLUME',+ symbol: 'NVDA',+ condition: 'Volume Above',+ trigger: '50M shares',+ status: 'ACTIVE',+ priority: 'MEDIUM',+ created: '2025-03-14 10:15',+ triggerCount: 0+ },+ {+ id: 'ALT004',+ type: 'INDICATOR',+ symbol: 'SPY',+ condition: 'RSI Below',+ trigger: '30',+ status: 'ACTIVE',+ priority: 'MEDIUM',+ created: '2025-03-13 15:45',+ triggerCount: 0+ },+ {+ id: 'ALT005',+ type: 'NEWS',+ symbol: 'MSFT',+ condition: 'News Sentiment',+ trigger: 'Negative < -0.5',+ status: 'DISABLED',+ priority: 'LOW',+ created: '2025-03-11 08:00',+ triggerCount: 0+ },+ {+ id: 'ALT006',+ type: 'EARNING',+ symbol: 'GOOGL',+ condition: 'Earnings Date',+ trigger: '2025-04-23',+ status: 'ACTIVE',+ priority: 'HIGH',+ created: '2025-03-01 12:00',+ triggerCount: 0+ },+ {+ id: 'ALT007',+ type: 'PRICE',+ symbol: 'JPM',+ condition: '% Change Above',+ trigger: '+5%',+ status: 'TRIGGERED',+ priority: 'HIGH',+ created: '2025-03-08 09:45',+ lastTriggered: '2025-03-15 10:23',+ triggerCount: 1+ },+ {+ id: 'ALT008',+ type: 'INDICATOR',+ symbol: 'QQQ',+ condition: 'MACD Cross',+ trigger: 'Bullish',+ status: 'ACTIVE',+ priority: 'MEDIUM',+ created: '2025-03-09 13:30',+ triggerCount: 0+ }+ ];++ const notifications: Notification[] = [+ {+ id: 'NOT001',+ time: '11:34:23',+ symbol: 'TSLA',+ type: 'PRICE ALERT',+ message: 'TSLA dropped below $185.00 - Current: $183.45',+ priority: 'HIGH',+ read: false+ },+ {+ id: 'NOT002',+ time: '10:23:45',+ symbol: 'JPM',+ type: 'PRICE ALERT',+ message: 'JPM gained +5.2% in last hour - Current: $187.23',+ priority: 'HIGH',+ read: false+ },+ {+ id: 'NOT003',+ time: '09:15:12',+ symbol: 'NVDA',+ type: 'VOLUME ALERT',+ message: 'NVDA volume spike: 52.3M shares traded (above 50M threshold)',+ priority: 'MEDIUM',+ read: true+ },+ {+ id: 'NOT004',+ time: '08:45:33',+ symbol: 'AAPL',+ type: 'NEWS ALERT',+ message: 'Breaking news: AAPL announces new product launch event',+ priority: 'HIGH',+ read: true+ },+ {+ id: 'NOT005',+ time: 'Yesterday',+ symbol: 'SPY',+ type: 'INDICATOR',+ message: 'SPY RSI dropped to 28.4 (oversold territory)',+ priority: 'MEDIUM',+ read: true+ }+ ];++ const watchedSymbols = [+ { symbol: 'AAPL', price: 178.45, change: 1.33, alerts: 2, status: 'NORMAL' },+ { symbol: 'TSLA', price: 183.45, change: -2.34, alerts: 3, status: 'TRIGGERED' },+ { symbol: 'NVDA', price: 878.34, change: 1.44, alerts: 1, status: 'NORMAL' },+ { symbol: 'MSFT', price: 412.34, change: 1.39, alerts: 1, status: 'DISABLED' },+ { symbol: 'GOOGL', price: 145.67, change: -0.84, alerts: 1, status: 'NORMAL' },+ { symbol: 'JPM', price: 187.23, change: 5.21, alerts: 2, status: 'TRIGGERED' }+ ];++ const filteredAlerts = alerts.filter(a =>+ (selectedType === 'ALL' || a.type === selectedType) &&+ (selectedStatus === 'ALL' || a.status === selectedStatus)+ );++ const getTypeColor = (type: string) => {+ switch(type) {+ case 'PRICE': return COLOR_GREEN;+ case 'VOLUME': return COLOR_BLUE;+ case 'INDICATOR': return COLOR_PURPLE;+ case 'NEWS': return COLOR_CYAN;+ case 'EARNING': return COLOR_YELLOW;+ default: return COLOR_WHITE;+ }+ };++ const getStatusColor = (status: string) => {+ switch(status) {+ case 'ACTIVE': return COLOR_GREEN;+ case 'TRIGGERED': return COLOR_ORANGE;+ case 'EXPIRED': return COLOR_GRAY;+ case 'DISABLED': return COLOR_RED;+ default: return COLOR_WHITE;+ }+ };++ const getPriorityColor = (priority: string) => {+ switch(priority) {+ case 'HIGH': return COLOR_RED;+ case 'MEDIUM': return COLOR_ORANGE;+ case 'LOW': return COLOR_YELLOW;+ default: return COLOR_GRAY;+ }+ };++ return (+ <div style={{+ height: '100%',+ backgroundColor: COLOR_DARK_BG,+ color: COLOR_WHITE,+ fontFamily: 'Consolas, monospace',+ overflow: 'hidden',+ display: 'flex',+ flexDirection: 'column',+ fontSize: '12px'+ }}>+ {/* Header */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ borderBottom: `2px solid ${COLOR_GRAY}`,+ padding: '8px 16px',+ flexShrink: 0+ }}>+ <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>+ <span style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '16px' }}>+ ALERTS & MONITORING+ </span>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <span style={{ color: COLOR_CYAN }}>REAL-TIME NOTIFICATIONS • CUSTOM TRIGGERS</span>+ </div>+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>+ <button+ onClick={() => setShowCreateModal(!showCreateModal)}+ style={{+ padding: '6px 16px',+ backgroundColor: COLOR_GREEN,+ border: 'none',+ color: COLOR_DARK_BG,+ fontSize: '11px',+ fontWeight: 'bold',+ cursor: 'pointer',+ fontFamily: 'Consolas, monospace'+ }}>+ + CREATE ALERT+ </button>+ <span style={{ color: COLOR_GRAY, fontSize: '11px' }}>+ {currentTime.toLocaleTimeString()}+ </span>+ </div>+ </div>+ </div>++ {/* Main Content */}+ <div style={{ flex: 1, overflow: 'auto', display: 'flex', gap: '12px', padding: '12px' }}>+ {/* Left Panel - Notifications & Watched */}+ <div style={{ width: '340px', display: 'flex', flexDirection: 'column', gap: '12px' }}>+ {/* Recent Notifications */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ border: `2px solid ${COLOR_GRAY}`,+ borderLeft: `6px solid ${COLOR_ORANGE}`,+ padding: '12px',+ maxHeight: '400px',+ overflow: 'auto'+ }}>+ <div style={{ color: COLOR_ORANGE, fontSize: '13px', fontWeight: 'bold', marginBottom: '12px' }}>+ RECENT NOTIFICATIONS+ </div>+ <div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>+ {notifications.map((notif, index) => (+ <div key={index} style={{+ padding: '10px',+ backgroundColor: notif.read ? 'rgba(255,255,255,0.02)' : 'rgba(255,165,0,0.1)',+ border: `1px solid ${notif.read ? COLOR_GRAY : COLOR_ORANGE}`,+ borderLeft: `4px solid ${getPriorityColor(notif.priority)}`+ }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '6px' }}>+ <span style={{ color: COLOR_CYAN, fontWeight: 'bold', fontSize: '11px' }}>+ {notif.symbol}+ </span>+ <span style={{ color: COLOR_GRAY, fontSize: '9px' }}>+ {notif.time}+ </span>+ </div>+ <div style={{ color: getPriorityColor(notif.priority), fontSize: '9px', fontWeight: 'bold', marginBottom: '4px' }}>+ {notif.type}+ </div>+ <div style={{ color: COLOR_WHITE, fontSize: '10px', lineHeight: '1.4' }}>+ {notif.message}+ </div>+ </div>+ ))}+ </div>+ </div>++ {/* Watched Symbols */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ border: `2px solid ${COLOR_GRAY}`,+ borderLeft: `6px solid ${COLOR_CYAN}`,+ padding: '12px'+ }}>+ <div style={{ color: COLOR_ORANGE, fontSize: '13px', fontWeight: 'bold', marginBottom: '12px' }}>+ WATCHED SYMBOLS+ </div>+ <div style={{ display: 'flex', flexDirection: 'column', gap: '6px' }}>+ {watchedSymbols.map((watch, index) => (+ <div key={index} style={{+ padding: '10px',+ backgroundColor: watch.status === 'TRIGGERED' ? 'rgba(255,165,0,0.1)' : 'rgba(255,255,255,0.02)',+ border: `1px solid ${watch.status === 'TRIGGERED' ? COLOR_ORANGE : COLOR_GRAY}`,+ display: 'flex',+ justifyContent: 'space-between',+ alignItems: 'center'+ }}>+ <div>+ <div style={{ color: COLOR_CYAN, fontWeight: 'bold', fontSize: '12px', marginBottom: '2px' }}>+ {watch.symbol}+ </div>+ <div style={{ color: watch.change > 0 ? COLOR_GREEN : COLOR_RED, fontSize: '10px' }}>+ ${watch.price.toFixed(2)} ({watch.change > 0 ? '+' : ''}{watch.change.toFixed(2)}%)+ </div>+ </div>+ <div style={{ textAlign: 'right' }}>+ <div style={{+ color: getStatusColor(watch.status),+ fontSize: '9px',+ fontWeight: 'bold',+ marginBottom: '4px'+ }}>+ {watch.status}+ </div>+ <div style={{ color: COLOR_GRAY, fontSize: '9px' }}>+ {watch.alerts} alert{watch.alerts !== 1 ? 's' : ''}+ </div>+ </div>+ </div>+ ))}+ </div>+ </div>++ {/* Alert Statistics */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ border: `2px solid ${COLOR_GRAY}`,+ borderLeft: `6px solid ${COLOR_PURPLE}`,+ padding: '12px'+ }}>+ <div style={{ color: COLOR_ORANGE, fontSize: '13px', fontWeight: 'bold', marginBottom: '12px' }}>+ ALERT STATISTICS+ </div>+ <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '8px' }}>+ <div style={{+ padding: '10px',+ backgroundColor: 'rgba(0,200,0,0.05)',+ border: `1px solid ${COLOR_GREEN}`,+ textAlign: 'center'+ }}>+ <div style={{ color: COLOR_GRAY, fontSize: '9px', marginBottom: '4px' }}>ACTIVE</div>+ <div style={{ color: COLOR_GREEN, fontSize: '20px', fontWeight: 'bold' }}>5</div>+ </div>+ <div style={{+ padding: '10px',+ backgroundColor: 'rgba(255,165,0,0.05)',+ border: `1px solid ${COLOR_ORANGE}`,+ textAlign: 'center'+ }}>+ <div style={{ color: COLOR_GRAY, fontSize: '9px', marginBottom: '4px' }}>TRIGGERED</div>+ <div style={{ color: COLOR_ORANGE, fontSize: '20px', fontWeight: 'bold' }}>2</div>+ </div>+ <div style={{+ padding: '10px',+ backgroundColor: 'rgba(255,0,0,0.05)',+ border: `1px solid ${COLOR_RED}`,+ textAlign: 'center'+ }}>+ <div style={{ color: COLOR_GRAY, fontSize: '9px', marginBottom: '4px' }}>DISABLED</div>+ <div style={{ color: COLOR_RED, fontSize: '20px', fontWeight: 'bold' }}>1</div>+ </div>+ <div style={{+ padding: '10px',+ backgroundColor: 'rgba(120,120,120,0.05)',+ border: `1px solid ${COLOR_GRAY}`,+ textAlign: 'center'+ }}>+ <div style={{ color: COLOR_GRAY, fontSize: '9px', marginBottom: '4px' }}>TOTAL</div>+ <div style={{ color: COLOR_CYAN, fontSize: '20px', fontWeight: 'bold' }}>8</div>+ </div>+ </div>+ </div>+ </div>++ {/* Right Panel - Alerts List */}+ <div style={{ flex: 1, display: 'flex', flexDirection: 'column' }}>+ {/* Filters */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ border: `2px solid ${COLOR_GRAY}`,+ padding: '12px',+ marginBottom: '12px'+ }}>+ <div style={{ display: 'flex', gap: '12px', alignItems: 'center' }}>+ <span style={{ color: COLOR_GRAY, fontSize: '11px' }}>TYPE:</span>+ {['ALL', 'PRICE', 'VOLUME', 'INDICATOR', 'NEWS', 'EARNING'].map((type) => (+ <button key={type}+ onClick={() => setSelectedType(type)}+ style={{+ padding: '6px 12px',+ backgroundColor: selectedType === type ? getTypeColor(type) : COLOR_DARK_BG,+ border: `2px solid ${selectedType === type ? getTypeColor(type) : COLOR_GRAY}`,+ color: selectedType === type ? COLOR_DARK_BG : COLOR_WHITE,+ fontSize: '10px',+ fontWeight: 'bold',+ cursor: 'pointer',+ fontFamily: 'Consolas, monospace'+ }}>+ {type}+ </button>+ ))}+ <span style={{ color: COLOR_GRAY, marginLeft: '16px' }}>|</span>+ <span style={{ color: COLOR_GRAY, fontSize: '11px' }}>STATUS:</span>+ {['ALL', 'ACTIVE', 'TRIGGERED', 'DISABLED'].map((status) => (+ <button key={status}+ onClick={() => setSelectedStatus(status)}+ style={{+ padding: '6px 12px',+ backgroundColor: selectedStatus === status ? getStatusColor(status) : COLOR_DARK_BG,+ border: `2px solid ${selectedStatus === status ? getStatusColor(status) : COLOR_GRAY}`,+ color: selectedStatus === status ? COLOR_DARK_BG : COLOR_WHITE,+ fontSize: '10px',+ fontWeight: 'bold',+ cursor: 'pointer',+ fontFamily: 'Consolas, monospace'+ }}>+ {status}+ </button>+ ))}+ </div>+ </div>++ {/* Alerts Table */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ border: `2px solid ${COLOR_GRAY}`,+ flex: 1,+ overflow: 'auto'+ }}>+ {/* Table Header */}+ <div style={{+ display: 'grid',+ gridTemplateColumns: '80px 80px 80px 200px 120px 100px 80px 140px 80px 80px',+ padding: '10px 12px',+ backgroundColor: 'rgba(255,165,0,0.1)',+ borderBottom: `2px solid ${COLOR_ORANGE}`,+ position: 'sticky',+ top: 0,+ zIndex: 10,+ fontSize: '10px'+ }}>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold' }}>ID</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold' }}>TYPE</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold' }}>SYMBOL</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold' }}>CONDITION</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold' }}>TRIGGER</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold' }}>STATUS</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold' }}>PRIORITY</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold' }}>CREATED</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold' }}>TRIGGERS</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold' }}>ACTIONS</div>+ </div>++ {/* Table Body */}+ {filteredAlerts.map((alert, index) => (+ <div key={index}+ style={{+ display: 'grid',+ gridTemplateColumns: '80px 80px 80px 200px 120px 100px 80px 140px 80px 80px',+ padding: '12px',+ backgroundColor: alert.status === 'TRIGGERED' ? 'rgba(255,165,0,0.05)' : (index % 2 === 0 ? 'rgba(255,255,255,0.02)' : 'transparent'),+ borderBottom: `1px solid ${COLOR_GRAY}`,+ borderLeft: `4px solid ${getPriorityColor(alert.priority)}`,+ cursor: 'pointer',+ fontSize: '11px'+ }}+ onMouseEnter={(e) => {+ e.currentTarget.style.backgroundColor = 'rgba(255,165,0,0.1)';+ }}+ onMouseLeave={(e) => {+ e.currentTarget.style.backgroundColor = alert.status === 'TRIGGERED' ? 'rgba(255,165,0,0.05)' : (index % 2 === 0 ? 'rgba(255,255,255,0.02)' : 'transparent');+ }}>+ <div style={{ color: COLOR_GRAY }}>{alert.id}</div>+ <div>+ <span style={{+ padding: '4px 6px',+ backgroundColor: `rgba(${alert.type === 'PRICE' ? '0,200,0' : alert.type === 'VOLUME' ? '100,150,250' : alert.type === 'INDICATOR' ? '200,100,255' : alert.type === 'NEWS' ? '0,255,255' : '255,255,0'},0.2)`,+ border: `1px solid ${getTypeColor(alert.type)}`,+ color: getTypeColor(alert.type),+ fontSize: '9px',+ fontWeight: 'bold'+ }}>+ {alert.type}+ </span>+ </div>+ <div style={{ color: COLOR_CYAN, fontWeight: 'bold' }}>{alert.symbol}</div>+ <div style={{ color: COLOR_WHITE }}>{alert.condition}</div>+ <div style={{ color: COLOR_YELLOW, fontWeight: 'bold' }}>{alert.trigger}</div>+ <div>+ <span style={{+ padding: '4px 8px',+ backgroundColor: `rgba(${alert.status === 'ACTIVE' ? '0,200,0' : alert.status === 'TRIGGERED' ? '255,165,0' : alert.status === 'DISABLED' ? '255,0,0' : '120,120,120'},0.2)`,+ border: `1px solid ${getStatusColor(alert.status)}`,+ color: getStatusColor(alert.status),+ fontSize: '9px',+ fontWeight: 'bold'+ }}>+ {alert.status}+ </span>+ </div>+ <div style={{ color: getPriorityColor(alert.priority), fontWeight: 'bold' }}>+ {alert.priority}+ </div>+ <div style={{ color: COLOR_GRAY, fontSize: '10px' }}>{alert.created}</div>+ <div style={{ color: alert.triggerCount > 0 ? COLOR_ORANGE : COLOR_GRAY }}>+ {alert.triggerCount}x+ </div>+ <div style={{ display: 'flex', gap: '4px' }}>+ <button style={{+ padding: '4px 8px',+ backgroundColor: COLOR_BLUE,+ border: 'none',+ color: COLOR_DARK_BG,+ fontSize: '9px',+ fontWeight: 'bold',+ cursor: 'pointer',+ fontFamily: 'Consolas, monospace'+ }}>+ EDIT+ </button>+ <button style={{+ padding: '4px 8px',+ backgroundColor: COLOR_RED,+ border: 'none',+ color: COLOR_DARK_BG,+ fontSize: '9px',+ fontWeight: 'bold',+ cursor: 'pointer',+ fontFamily: 'Consolas, monospace'+ }}>+ DEL+ </button>+ </div>+ </div>+ ))}+ </div>+ </div>+ </div>++ {/* Footer */}+ <div style={{+ borderTop: `3px solid ${COLOR_ORANGE}`,+ backgroundColor: COLOR_PANEL_BG,+ padding: '12px 16px',+ fontSize: '11px',+ color: COLOR_WHITE,+ flexShrink: 0+ }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '8px' }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '16px' }}>+ <span style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '13px' }}>+ ALERTS & MONITORING v1.0+ </span>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <span style={{ color: COLOR_CYAN }}>+ Real-time market alerts & notifications+ </span>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <span style={{ color: COLOR_GREEN }}>+ {filteredAlerts.length} alerts shown+ </span>+ </div>+ </div>+ <div style={{+ display: 'flex',+ justifyContent: 'space-between',+ fontSize: '10px',+ paddingTop: '8px',+ borderTop: `1px solid ${COLOR_GRAY}`+ }}>+ <div style={{ display: 'flex', gap: '16px' }}>+ <span style={{ color: COLOR_GRAY }}><span style={{ color: COLOR_BLUE }}>F1</span> Help</span>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <span style={{ color: COLOR_GRAY }}><span style={{ color: COLOR_BLUE }}>F2</span> Create Alert</span>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <span style={{ color: COLOR_GRAY }}><span style={{ color: COLOR_BLUE }}>F3</span> Test Alert</span>+ </div>+ <div style={{ color: COLOR_GRAY }}>+ © 2025 Fincept Labs • All Rights Reserved+ </div>+ </div>+ </div>+ </div>+ );+};++export default AlertsTab;\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/tabs/AnalyticsTab.tsx b/fincept-terminal-desktop/src/components/tabs/AnalyticsTab.tsxnew file mode 100644index 000000000..bb6ab3293--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/AnalyticsTab.tsx@@ -0,0 +1,641 @@+import React, { useState, useEffect } from 'react';+import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer, BarChart, Bar, PieChart, Pie, Cell, AreaChart, Area, ScatterChart, Scatter, RadarChart, PolarGrid, PolarAngleAxis, PolarRadiusAxis, Radar, ComposedChart, ReferenceLine, Treemap, FunnelChart, Funnel, LabelList } from 'recharts';++const AnalyticsTab: React.FC = () => {+ const [currentTime, setCurrentTime] = useState(new Date());+ const [dataUpdateCount, setDataUpdateCount] = useState(0);+ const [alertCount, setAlertCount] = useState(23);++ // Bloomberg color scheme (exact from DearPyGUI)+ const BLOOMBERG_ORANGE = '#FFA500';+ const BLOOMBERG_WHITE = '#FFFFFF';+ const BLOOMBERG_RED = '#FF0000';+ const BLOOMBERG_GREEN = '#00C800';+ const BLOOMBERG_YELLOW = '#FFFF00';+ const BLOOMBERG_GRAY = '#787878';+ const BLOOMBERG_BLUE = '#6496FA';+ const BLOOMBERG_PURPLE = '#C864FF';+ const BLOOMBERG_CYAN = '#00FFFF';+ const BLOOMBERG_DARK_BG = '#000000';+ const BLOOMBERG_PANEL_BG = '#0a0a0a';++ useEffect(() => {+ const timer = setInterval(() => {+ setCurrentTime(new Date());+ setDataUpdateCount(prev => prev + 1);+ if (Math.random() > 0.8) setAlertCount(prev => prev + 1);+ }, 2000);+ return () => clearInterval(timer);+ }, []);++ // Generate various chart data+ const priceData = Array.from({ length: 30 }, (_, i) => ({+ time: i + 1,+ price: 150 + Math.sin(i * 0.1) * 20 + Math.random() * 10,+ volume: Math.random() * 1000000 + 500000,+ high: 150 + Math.sin(i * 0.1) * 20 + Math.random() * 15 + 5,+ low: 150 + Math.sin(i * 0.1) * 20 + Math.random() * 15 - 5,+ volatility: Math.random() * 5 + 2+ }));++ const sectorData = [+ { sector: 'Technology', value: 28.5, growth: 12.4, pe: 24.8 },+ { sector: 'Healthcare', value: 15.2, growth: 8.7, pe: 18.9 },+ { sector: 'Finance', value: 18.9, growth: 6.3, pe: 14.2 },+ { sector: 'Energy', value: 12.1, growth: 15.8, pe: 12.5 },+ { sector: 'Consumer', value: 14.7, growth: 4.2, pe: 22.1 },+ { sector: 'Industrial', value: 10.6, growth: 7.9, pe: 16.7 }+ ];++ const correlationData = Array.from({ length: 20 }, (_, i) => ({+ x: Math.random() * 10,+ y: Math.random() * 10,+ size: Math.random() * 100 + 20+ }));++ const portfolioData = [+ { asset: 'Stocks', allocation: 65, returns: 14.2, risk: 18.5 },+ { asset: 'Bonds', allocation: 25, returns: 4.8, risk: 6.2 },+ { asset: 'Commodities', allocation: 7, returns: 8.9, risk: 22.1 },+ { asset: 'Cash', allocation: 3, returns: 2.1, risk: 0.5 }+ ];++ const riskMetrics = Array.from({ length: 90 }, (_, i) => ({+ day: i + 1,+ var: Math.random() * 5 + 2,+ sharpe: Math.random() * 2 + 0.5,+ beta: Math.random() * 1.5 + 0.5,+ alpha: Math.random() * 4 - 2,+ drawdown: Math.random() * 15+ }));++ const momentumData = Array.from({ length: 50 }, (_, i) => ({+ stock: i + 1,+ momentum: Math.random() * 100 - 50,+ rsi: Math.random() * 100,+ macd: Math.random() * 10 - 5+ }));++ const liquidityData = Array.from({ length: 24 }, (_, i) => ({+ hour: i,+ volume: Math.random() * 1000000 + 200000,+ spread: Math.random() * 0.5 + 0.1,+ depth: Math.random() * 50000 + 10000+ }));++ const technicalData = Array.from({ length: 30 }, (_, i) => ({+ period: i + 1,+ price: 100 + Math.sin(i * 0.2) * 15 + Math.random() * 5,+ sma20: 100 + Math.sin((i - 2) * 0.2) * 12,+ ema12: 100 + Math.sin((i - 1) * 0.2) * 13,+ bb_upper: 100 + Math.sin(i * 0.2) * 15 + 10,+ bb_lower: 100 + Math.sin(i * 0.2) * 15 - 10+ }));++ const fundamentalData = [+ { metric: 'P/E Ratio', value: 22.8, benchmark: 18.5 },+ { metric: 'EV/EBITDA', value: 14.2, benchmark: 12.1 },+ { metric: 'P/B Ratio', value: 3.4, benchmark: 2.8 },+ { metric: 'ROE', value: 18.7, benchmark: 15.2 },+ { metric: 'ROA', value: 8.9, benchmark: 7.1 },+ { metric: 'Debt/Equity', value: 0.65, benchmark: 0.8 }+ ];++ const optionsData = Array.from({ length: 10 }, (_, i) => ({+ strike: 140 + i * 5,+ calls: Math.random() * 1000 + 100,+ puts: Math.random() * 800 + 50,+ iv: Math.random() * 40 + 20,+ delta: 1 - (i / 10),+ gamma: Math.random() * 0.1,+ theta: -Math.random() * 0.5+ }));++ const volatilityData = Array.from({ length: 252 }, (_, i) => ({+ day: i + 1,+ realized: Math.random() * 40 + 10,+ implied: Math.random() * 45 + 15,+ historical: Math.random() * 35 + 12+ }));++ const economicData = [+ { indicator: 'GDP Growth', current: 6.7, forecast: 6.4, impact: 'High' },+ { indicator: 'Inflation', current: 4.2, forecast: 3.8, impact: 'Critical' },+ { indicator: 'Unemployment', current: 3.8, forecast: 4.1, impact: 'Medium' },+ { indicator: 'Interest Rate', current: 5.25, forecast: 5.5, impact: 'Critical' },+ { indicator: 'Oil Price', current: 82.45, forecast: 85.2, impact: 'High' }+ ];++ const sentimentData = Array.from({ length: 30 }, (_, i) => ({+ date: i + 1,+ bullish: Math.random() * 100,+ bearish: Math.random() * 100,+ neutral: Math.random() * 100,+ fear: Math.random() * 100,+ greed: Math.random() * 100+ }));++ const flowsData = Array.from({ length: 20 }, (_, i) => ({+ date: i + 1,+ inflows: Math.random() * 2000 - 1000,+ outflows: Math.random() * 1500 - 750,+ net: Math.random() * 1000 - 500+ }));++ const performanceData = [+ { period: '1D', return: 1.2, benchmark: 0.8 },+ { period: '1W', return: 3.4, benchmark: 2.1 },+ { period: '1M', return: 8.7, benchmark: 6.2 },+ { period: '3M', return: 15.2, benchmark: 12.8 },+ { period: '6M', return: 24.6, benchmark: 18.9 },+ { period: '1Y', return: 34.8, benchmark: 28.4 }+ ];++ const attribution = [+ { factor: 'Stock Selection', contribution: 4.8 },+ { factor: 'Sector Allocation', contribution: 2.3 },+ { factor: 'Market Timing', contribution: -1.2 },+ { factor: 'Currency', contribution: 0.8 },+ { factor: 'Other', contribution: 1.4 }+ ];++ const moneyFlowData = Array.from({ length: 30 }, (_, i) => ({+ day: i + 1,+ mfi: Math.random() * 100,+ obv: Math.random() * 1000000,+ adl: Math.random() * 50000 - 25000,+ cmf: Math.random() * 0.4 - 0.2+ }));++ const marketData = [+ { market: 'US', weight: 55.2, return: 12.4, volatility: 16.8 },+ { market: 'Europe', weight: 18.7, return: 8.9, volatility: 19.2 },+ { market: 'Asia', weight: 15.8, return: 15.6, volatility: 22.1 },+ { market: 'Emerging', weight: 10.3, return: 18.2, volatility: 28.4 }+ ];++ const bondData = Array.from({ length: 30 }, (_, i) => ({+ maturity: i / 2 + 0.25,+ yield: 3.5 + (i * 0.1) + Math.random() * 0.5,+ duration: i / 3 + 1,+ spread: Math.random() * 200 + 50+ }));++ const derivativesData = Array.from({ length: 15 }, (_, i) => ({+ type: ['Futures', 'Options', 'Swaps', 'Forwards'][i % 4],+ notional: Math.random() * 10000000 + 1000000,+ pnl: Math.random() * 100000 - 50000,+ risk: Math.random() * 50000 + 10000+ }));++ const stressData = [+ { scenario: 'Base Case', probability: 60, impact: 0 },+ { scenario: 'Recession', probability: 25, impact: -25 },+ { scenario: 'Market Crash', probability: 10, impact: -45 },+ { scenario: 'Black Swan', probability: 5, impact: -65 }+ ];++ // Chart component wrapper with Bloomberg styling+ const ChartBox = ({ title, children, width = "100%", height = "160px" }: {+ title: string,+ children: React.ReactNode,+ width?: string,+ height?: string+ }) => (+ <div style={{+ backgroundColor: BLOOMBERG_PANEL_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '4px',+ height,+ width,+ overflow: 'hidden'+ }}>+ <div style={{+ color: BLOOMBERG_ORANGE,+ fontSize: '10px',+ fontWeight: 'bold',+ marginBottom: '2px',+ textAlign: 'center',+ borderBottom: `1px solid ${BLOOMBERG_GRAY}`,+ paddingBottom: '2px'+ }}>+ {title}+ </div>+ <div style={{ height: 'calc(100% - 20px)' }}>+ {children}+ </div>+ </div>+ );++ return (+ <div style={{+ height: '100%',+ backgroundColor: BLOOMBERG_DARK_BG,+ color: BLOOMBERG_WHITE,+ fontFamily: 'Consolas, monospace',+ overflow: 'hidden',+ display: 'flex',+ flexDirection: 'column',+ fontSize: '12px'+ }}>+ {/* Header */}+ <div style={{+ backgroundColor: BLOOMBERG_PANEL_BG,+ borderBottom: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '4px 8px',+ flexShrink: 0+ }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px', fontSize: '13px', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_ORANGE, fontWeight: 'bold' }}>FINANCIAL ANALYTICS DASHBOARD</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_GREEN, fontWeight: 'bold' }}>PORTFOLIO VALUE: $2.45M</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_BLUE }}>P&L TODAY: +$12,456 (+0.51%)</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_YELLOW }}>ALERTS: {alertCount}</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_GREEN }}>● LIVE DATA</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_WHITE }}>{currentTime.toISOString().replace('T', ' ').substring(0, 19)} UTC</span>+ </div>++ <div style={{ display: 'flex', alignItems: 'center', gap: '8px', fontSize: '11px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>ANALYTICS:</span>+ <span style={{ color: BLOOMBERG_GREEN }}>RISK●</span>+ <span style={{ color: BLOOMBERG_GREEN }}>PERFORMANCE●</span>+ <span style={{ color: BLOOMBERG_GREEN }}>ATTRIBUTION●</span>+ <span style={{ color: BLOOMBERG_GREEN }}>TECHNICAL●</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_GRAY }}>MODELS:</span>+ <span style={{ color: BLOOMBERG_BLUE }}>VaR: $45K</span>+ <span style={{ color: BLOOMBERG_YELLOW }}>Sharpe: 1.84</span>+ <span style={{ color: BLOOMBERG_PURPLE }}>Beta: 0.97</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_GRAY }}>UPDATES:</span>+ <span style={{ color: BLOOMBERG_CYAN }}>{dataUpdateCount}</span>+ </div>+ </div>++ {/* Function Keys Bar */}+ <div style={{+ backgroundColor: BLOOMBERG_PANEL_BG,+ borderBottom: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '2px 4px',+ flexShrink: 0+ }}>+ <div style={{ display: 'grid', gridTemplateColumns: 'repeat(10, 1fr)', gap: '2px' }}>+ {[+ { key: "F1", label: "RISK", status: "●" },+ { key: "F2", label: "PERF", status: "●" },+ { key: "F3", label: "TECH", status: "●" },+ { key: "F4", label: "FUND", status: "●" },+ { key: "F5", label: "OPTIONS", status: "●" },+ { key: "F6", label: "FLOWS", status: "●" },+ { key: "F7", label: "STRESS", status: "◐" },+ { key: "F8", label: "DERIV", status: "●" },+ { key: "F9", label: "MACRO", status: "●" },+ { key: "F10", label: "ALERT", status: "●" }+ ].map(item => (+ <button key={item.key} style={{+ backgroundColor: BLOOMBERG_DARK_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ color: BLOOMBERG_WHITE,+ padding: '2px 4px',+ fontSize: '9px',+ height: '16px',+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'center'+ }}>+ <span style={{ color: BLOOMBERG_YELLOW }}>{item.key}:</span>+ <span style={{ marginLeft: '2px' }}>{item.label}</span>+ <span style={{+ marginLeft: '2px',+ color: item.status === '●' ? BLOOMBERG_GREEN : BLOOMBERG_YELLOW+ }}>+ {item.status}+ </span>+ </button>+ ))}+ </div>+ </div>++ {/* Main Content - 4x5 Grid (20 charts) */}+ <div style={{ flex: 1, overflow: 'auto', padding: '2px', backgroundColor: '#050505' }}>+ <div style={{+ display: 'grid',+ gridTemplateColumns: 'repeat(5, 1fr)',+ gridTemplateRows: 'repeat(4, 1fr)',+ gap: '3px',+ height: '100%'+ }}>+ {/* Row 1 */}+ <ChartBox title="PRICE & VOLUME">+ <ResponsiveContainer width="100%" height="100%">+ <ComposedChart data={priceData.slice(0, 15)}>+ <CartesianGrid strokeDasharray="1 1" stroke={BLOOMBERG_GRAY} opacity={0.3} />+ <XAxis dataKey="time" stroke={BLOOMBERG_WHITE} fontSize={8} />+ <YAxis stroke={BLOOMBERG_WHITE} fontSize={8} />+ <Tooltip contentStyle={{ backgroundColor: BLOOMBERG_DARK_BG, border: `1px solid ${BLOOMBERG_GRAY}`, fontSize: '9px' }} />+ <Line type="monotone" dataKey="price" stroke={BLOOMBERG_BLUE} strokeWidth={1} dot={false} />+ <Bar dataKey="volume" fill={BLOOMBERG_GRAY} opacity={0.3} />+ </ComposedChart>+ </ResponsiveContainer>+ </ChartBox>++ <ChartBox title="SECTOR ALLOCATION">+ <ResponsiveContainer width="100%" height="100%">+ <PieChart>+ <Pie+ data={sectorData}+ dataKey="value"+ nameKey="sector"+ cx="50%"+ cy="50%"+ outerRadius={50}+ fill={BLOOMBERG_BLUE}+ >+ {sectorData.map((entry, index) => (+ <Cell key={`cell-${index}`} fill={[BLOOMBERG_BLUE, BLOOMBERG_GREEN, BLOOMBERG_YELLOW, BLOOMBERG_RED, BLOOMBERG_PURPLE, BLOOMBERG_CYAN][index % 6]} />+ ))}+ </Pie>+ <Tooltip contentStyle={{ backgroundColor: BLOOMBERG_DARK_BG, border: `1px solid ${BLOOMBERG_GRAY}`, fontSize: '9px' }} />+ </PieChart>+ </ResponsiveContainer>+ </ChartBox>++ <ChartBox title="CORRELATION SCATTER">+ <ResponsiveContainer width="100%" height="100%">+ <ScatterChart data={correlationData}>+ <CartesianGrid strokeDasharray="1 1" stroke={BLOOMBERG_GRAY} opacity={0.3} />+ <XAxis stroke={BLOOMBERG_WHITE} fontSize={8} />+ <YAxis stroke={BLOOMBERG_WHITE} fontSize={8} />+ <Tooltip contentStyle={{ backgroundColor: BLOOMBERG_DARK_BG, border: `1px solid ${BLOOMBERG_GRAY}`, fontSize: '9px' }} />+ <Scatter dataKey="y" fill={BLOOMBERG_GREEN} />+ </ScatterChart>+ </ResponsiveContainer>+ </ChartBox>++ <ChartBox title="PORTFOLIO COMPOSITION">+ <ResponsiveContainer width="100%" height="100%">+ <BarChart data={portfolioData}>+ <CartesianGrid strokeDasharray="1 1" stroke={BLOOMBERG_GRAY} opacity={0.3} />+ <XAxis dataKey="asset" stroke={BLOOMBERG_WHITE} fontSize={8} />+ <YAxis stroke={BLOOMBERG_WHITE} fontSize={8} />+ <Tooltip contentStyle={{ backgroundColor: BLOOMBERG_DARK_BG, border: `1px solid ${BLOOMBERG_GRAY}`, fontSize: '9px' }} />+ <Bar dataKey="allocation" fill={BLOOMBERG_ORANGE} />+ </BarChart>+ </ResponsiveContainer>+ </ChartBox>++ <ChartBox title="RISK METRICS">+ <ResponsiveContainer width="100%" height="100%">+ <LineChart data={riskMetrics.slice(0, 20)}>+ <CartesianGrid strokeDasharray="1 1" stroke={BLOOMBERG_GRAY} opacity={0.3} />+ <XAxis dataKey="day" stroke={BLOOMBERG_WHITE} fontSize={8} />+ <YAxis stroke={BLOOMBERG_WHITE} fontSize={8} />+ <Tooltip contentStyle={{ backgroundColor: BLOOMBERG_DARK_BG, border: `1px solid ${BLOOMBERG_GRAY}`, fontSize: '9px' }} />+ <Line type="monotone" dataKey="var" stroke={BLOOMBERG_RED} strokeWidth={1} dot={false} />+ <Line type="monotone" dataKey="sharpe" stroke={BLOOMBERG_GREEN} strokeWidth={1} dot={false} />+ </LineChart>+ </ResponsiveContainer>+ </ChartBox>++ {/* Row 2 */}+ <ChartBox title="MOMENTUM ANALYSIS">+ <ResponsiveContainer width="100%" height="100%">+ <BarChart data={momentumData.slice(0, 10)}>+ <CartesianGrid strokeDasharray="1 1" stroke={BLOOMBERG_GRAY} opacity={0.3} />+ <XAxis dataKey="stock" stroke={BLOOMBERG_WHITE} fontSize={8} />+ <YAxis stroke={BLOOMBERG_WHITE} fontSize={8} />+ <Tooltip contentStyle={{ backgroundColor: BLOOMBERG_DARK_BG, border: `1px solid ${BLOOMBERG_GRAY}`, fontSize: '9px' }} />+ <Bar dataKey="momentum" fill={(entry) => entry.momentum > 0 ? BLOOMBERG_GREEN : BLOOMBERG_RED} />+ </BarChart>+ </ResponsiveContainer>+ </ChartBox>++ <ChartBox title="INTRADAY LIQUIDITY">+ <ResponsiveContainer width="100%" height="100%">+ <AreaChart data={liquidityData}>+ <CartesianGrid strokeDasharray="1 1" stroke={BLOOMBERG_GRAY} opacity={0.3} />+ <XAxis dataKey="hour" stroke={BLOOMBERG_WHITE} fontSize={8} />+ <YAxis stroke={BLOOMBERG_WHITE} fontSize={8} />+ <Tooltip contentStyle={{ backgroundColor: BLOOMBERG_DARK_BG, border: `1px solid ${BLOOMBERG_GRAY}`, fontSize: '9px' }} />+ <Area type="monotone" dataKey="volume" stroke={BLOOMBERG_CYAN} fill={BLOOMBERG_CYAN} fillOpacity={0.3} />+ </AreaChart>+ </ResponsiveContainer>+ </ChartBox>++ <ChartBox title="TECHNICAL INDICATORS">+ <ResponsiveContainer width="100%" height="100%">+ <LineChart data={technicalData}>+ <CartesianGrid strokeDasharray="1 1" stroke={BLOOMBERG_GRAY} opacity={0.3} />+ <XAxis dataKey="period" stroke={BLOOMBERG_WHITE} fontSize={8} />+ <YAxis stroke={BLOOMBERG_WHITE} fontSize={8} />+ <Tooltip contentStyle={{ backgroundColor: BLOOMBERG_DARK_BG, border: `1px solid ${BLOOMBERG_GRAY}`, fontSize: '9px' }} />+ <Line type="monotone" dataKey="price" stroke={BLOOMBERG_WHITE} strokeWidth={2} dot={false} />+ <Line type="monotone" dataKey="sma20" stroke={BLOOMBERG_YELLOW} strokeWidth={1} dot={false} />+ <Line type="monotone" dataKey="ema12" stroke={BLOOMBERG_GREEN} strokeWidth={1} dot={false} />+ </LineChart>+ </ResponsiveContainer>+ </ChartBox>++ <ChartBox title="FUNDAMENTAL RATIOS">+ <ResponsiveContainer width="100%" height="100%">+ <BarChart data={fundamentalData} layout="horizontal">+ <CartesianGrid strokeDasharray="1 1" stroke={BLOOMBERG_GRAY} opacity={0.3} />+ <XAxis type="number" stroke={BLOOMBERG_WHITE} fontSize={8} />+ <YAxis type="category" dataKey="metric" stroke={BLOOMBERG_WHITE} fontSize={8} />+ <Tooltip contentStyle={{ backgroundColor: BLOOMBERG_DARK_BG, border: `1px solid ${BLOOMBERG_GRAY}`, fontSize: '9px' }} />+ <Bar dataKey="value" fill={BLOOMBERG_BLUE} />+ <Bar dataKey="benchmark" fill={BLOOMBERG_GRAY} opacity={0.5} />+ </BarChart>+ </ResponsiveContainer>+ </ChartBox>++ <ChartBox title="OPTIONS FLOW">+ <ResponsiveContainer width="100%" height="100%">+ <ComposedChart data={optionsData}>+ <CartesianGrid strokeDasharray="1 1" stroke={BLOOMBERG_GRAY} opacity={0.3} />+ <XAxis dataKey="strike" stroke={BLOOMBERG_WHITE} fontSize={8} />+ <YAxis stroke={BLOOMBERG_WHITE} fontSize={8} />+ <Tooltip contentStyle={{ backgroundColor: BLOOMBERG_DARK_BG, border: `1px solid ${BLOOMBERG_GRAY}`, fontSize: '9px' }} />+ <Bar dataKey="calls" fill={BLOOMBERG_GREEN} />+ <Bar dataKey="puts" fill={BLOOMBERG_RED} />+ <Line type="monotone" dataKey="iv" stroke={BLOOMBERG_YELLOW} strokeWidth={1} />+ </ComposedChart>+ </ResponsiveContainer>+ </ChartBox>++ {/* Row 3 */}+ <ChartBox title="VOLATILITY SURFACE">+ <ResponsiveContainer width="100%" height="100%">+ <AreaChart data={volatilityData.slice(0, 30)}>+ <CartesianGrid strokeDasharray="1 1" stroke={BLOOMBERG_GRAY} opacity={0.3} />+ <XAxis dataKey="day" stroke={BLOOMBERG_WHITE} fontSize={8} />+ <YAxis stroke={BLOOMBERG_WHITE} fontSize={8} />+ <Tooltip contentStyle={{ backgroundColor: BLOOMBERG_DARK_BG, border: `1px solid ${BLOOMBERG_GRAY}`, fontSize: '9px' }} />+ <Area type="monotone" dataKey="realized" stackId="1" stroke={BLOOMBERG_GREEN} fill={BLOOMBERG_GREEN} fillOpacity={0.6} />+ <Area type="monotone" dataKey="implied" stackId="1" stroke={BLOOMBERG_YELLOW} fill={BLOOMBERG_YELLOW} fillOpacity={0.6} />+ </AreaChart>+ </ResponsiveContainer>+ </ChartBox>++ <ChartBox title="ECONOMIC INDICATORS">+ <ResponsiveContainer width="100%" height="100%">+ <BarChart data={economicData}>+ <CartesianGrid strokeDasharray="1 1" stroke={BLOOMBERG_GRAY} opacity={0.3} />+ <XAxis dataKey="indicator" stroke={BLOOMBERG_WHITE} fontSize={7} angle={-45} />+ <YAxis stroke={BLOOMBERG_WHITE} fontSize={8} />+ <Tooltip contentStyle={{ backgroundColor: BLOOMBERG_DARK_BG, border: `1px solid ${BLOOMBERG_GRAY}`, fontSize: '9px' }} />+ <Bar dataKey="current" fill={BLOOMBERG_BLUE} />+ <Bar dataKey="forecast" fill={BLOOMBERG_ORANGE} />+ </BarChart>+ </ResponsiveContainer>+ </ChartBox>++ <ChartBox title="MARKET SENTIMENT">+ <ResponsiveContainer width="100%" height="100%">+ <AreaChart data={sentimentData.slice(0, 15)}>+ <CartesianGrid strokeDasharray="1 1" stroke={BLOOMBERG_GRAY} opacity={0.3} />+ <XAxis dataKey="date" stroke={BLOOMBERG_WHITE} fontSize={8} />+ <YAxis stroke={BLOOMBERG_WHITE} fontSize={8} />+ <Tooltip contentStyle={{ backgroundColor: BLOOMBERG_DARK_BG, border: `1px solid ${BLOOMBERG_GRAY}`, fontSize: '9px' }} />+ <Area type="monotone" dataKey="bullish" stackId="1" stroke={BLOOMBERG_GREEN} fill={BLOOMBERG_GREEN} fillOpacity={0.4} />+ <Area type="monotone" dataKey="bearish" stackId="1" stroke={BLOOMBERG_RED} fill={BLOOMBERG_RED} fillOpacity={0.4} />+ </AreaChart>+ </ResponsiveContainer>+ </ChartBox>++ <ChartBox title="FUND FLOWS">+ <ResponsiveContainer width="100%" height="100%">+ <ComposedChart data={flowsData}>+ <CartesianGrid strokeDasharray="1 1" stroke={BLOOMBERG_GRAY} opacity={0.3} />+ <XAxis dataKey="date" stroke={BLOOMBERG_WHITE} fontSize={8} />+ <YAxis stroke={BLOOMBERG_WHITE} fontSize={8} />+ <Tooltip contentStyle={{ backgroundColor: BLOOMBERG_DARK_BG, border: `1px solid ${BLOOMBERG_GRAY}`, fontSize: '9px' }} />+ <Bar dataKey="inflows" fill={BLOOMBERG_GREEN} />+ <Bar dataKey="outflows" fill={BLOOMBERG_RED} />+ <Line type="monotone" dataKey="net" stroke={BLOOMBERG_YELLOW} strokeWidth={2} />+ </ComposedChart>+ </ResponsiveContainer>+ </ChartBox>++ <ChartBox title="PERFORMANCE ATTRIBUTION">+ <ResponsiveContainer width="100%" height="100%">+ <BarChart data={performanceData}>+ <CartesianGrid strokeDasharray="1 1" stroke={BLOOMBERG_GRAY} opacity={0.3} />+ <XAxis dataKey="period" stroke={BLOOMBERG_WHITE} fontSize={8} />+ <YAxis stroke={BLOOMBERG_WHITE} fontSize={8} />+ <Tooltip contentStyle={{ backgroundColor: BLOOMBERG_DARK_BG, border: `1px solid ${BLOOMBERG_GRAY}`, fontSize: '9px' }} />+ <Bar dataKey="return" fill={BLOOMBERG_GREEN} />+ <Bar dataKey="benchmark" fill={BLOOMBERG_GRAY} opacity={0.5} />+ </BarChart>+ </ResponsiveContainer>+ </ChartBox>++ {/* Row 4 */}+ <ChartBox title="FACTOR ATTRIBUTION">+ <ResponsiveContainer width="100%" height="100%">+ <BarChart data={attribution} layout="horizontal">+ <CartesianGrid strokeDasharray="1 1" stroke={BLOOMBERG_GRAY} opacity={0.3} />+ <XAxis type="number" stroke={BLOOMBERG_WHITE} fontSize={8} />+ <YAxis type="category" dataKey="factor" stroke={BLOOMBERG_WHITE} fontSize={8} />+ <Tooltip contentStyle={{ backgroundColor: BLOOMBERG_DARK_BG, border: `1px solid ${BLOOMBERG_GRAY}`, fontSize: '9px' }} />+ <Bar dataKey="contribution" fill={(entry) => entry.contribution > 0 ? BLOOMBERG_GREEN : BLOOMBERG_RED} />+ </BarChart>+ </ResponsiveContainer>+ </ChartBox>++ <ChartBox title="MONEY FLOW INDEX">+ <ResponsiveContainer width="100%" height="100%">+ <LineChart data={moneyFlowData}>+ <CartesianGrid strokeDasharray="1 1" stroke={BLOOMBERG_GRAY} opacity={0.3} />+ <XAxis dataKey="day" stroke={BLOOMBERG_WHITE} fontSize={8} />+ <YAxis stroke={BLOOMBERG_WHITE} fontSize={8} />+ <Tooltip contentStyle={{ backgroundColor: BLOOMBERG_DARK_BG, border: `1px solid ${BLOOMBERG_GRAY}`, fontSize: '9px' }} />+ <Line type="monotone" dataKey="mfi" stroke={BLOOMBERG_PURPLE} strokeWidth={1} dot={false} />+ <ReferenceLine y={20} stroke={BLOOMBERG_RED} strokeDasharray="2 2" />+ <ReferenceLine y={80} stroke={BLOOMBERG_RED} strokeDasharray="2 2" />+ </LineChart>+ </ResponsiveContainer>+ </ChartBox>++ <ChartBox title="GLOBAL MARKETS">+ <ResponsiveContainer width="100%" height="100%">+ <RadarChart data={marketData}>+ <PolarGrid stroke={BLOOMBERG_GRAY} />+ <PolarAngleAxis dataKey="market" tick={{ fontSize: 9, fill: BLOOMBERG_WHITE }} />+ <PolarRadiusAxis tick={{ fontSize: 8, fill: BLOOMBERG_GRAY }} />+ <Radar+ name="Return"+ dataKey="return"+ stroke={BLOOMBERG_GREEN}+ fill={BLOOMBERG_GREEN}+ fillOpacity={0.3}+ />+ <Radar+ name="Volatility"+ dataKey="volatility"+ stroke={BLOOMBERG_RED}+ fill={BLOOMBERG_RED}+ fillOpacity={0.2}+ />+ <Tooltip contentStyle={{ backgroundColor: BLOOMBERG_DARK_BG, border: `1px solid ${BLOOMBERG_GRAY}`, fontSize: '9px' }} />+ </RadarChart>+ </ResponsiveContainer>+ </ChartBox>++ <ChartBox title="YIELD CURVE">+ <ResponsiveContainer width="100%" height="100%">+ <AreaChart data={bondData}>+ <CartesianGrid strokeDasharray="1 1" stroke={BLOOMBERG_GRAY} opacity={0.3} />+ <XAxis dataKey="maturity" stroke={BLOOMBERG_WHITE} fontSize={8} />+ <YAxis stroke={BLOOMBERG_WHITE} fontSize={8} />+ <Tooltip contentStyle={{ backgroundColor: BLOOMBERG_DARK_BG, border: `1px solid ${BLOOMBERG_GRAY}`, fontSize: '9px' }} />+ <Area type="monotone" dataKey="yield" stroke={BLOOMBERG_YELLOW} fill={BLOOMBERG_YELLOW} fillOpacity={0.3} />+ </AreaChart>+ </ResponsiveContainer>+ </ChartBox>++ <ChartBox title="STRESS SCENARIOS">+ <ResponsiveContainer width="100%" height="100%">+ <ComposedChart data={stressData}>+ <CartesianGrid strokeDasharray="1 1" stroke={BLOOMBERG_GRAY} opacity={0.3} />+ <XAxis dataKey="scenario" stroke={BLOOMBERG_WHITE} fontSize={7} angle={-45} />+ <YAxis stroke={BLOOMBERG_WHITE} fontSize={8} />+ <Tooltip contentStyle={{ backgroundColor: BLOOMBERG_DARK_BG, border: `1px solid ${BLOOMBERG_GRAY}`, fontSize: '9px' }} />+ <Bar dataKey="probability" fill={BLOOMBERG_BLUE} />+ <Line type="monotone" dataKey="impact" stroke={BLOOMBERG_RED} strokeWidth={2} />+ </ComposedChart>+ </ResponsiveContainer>+ </ChartBox>+ </div>+ </div>++ {/* Status Bar */}+ <div style={{+ borderTop: `1px solid ${BLOOMBERG_GRAY}`,+ backgroundColor: BLOOMBERG_PANEL_BG,+ padding: '2px 8px',+ fontSize: '10px',+ color: BLOOMBERG_GRAY,+ flexShrink: 0+ }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>+ <div style={{ display: 'flex', gap: '16px' }}>+ <span>Financial Analytics System v2.8.1 | Real-time portfolio analysis</span>+ <span>Models: 47 Active | Data Sources: 23 | Processing: 1.2M ticks/min</span>+ </div>+ <div style={{ display: 'flex', gap: '16px' }}>+ <span>Risk: VaR $45K | Sharpe: 1.84 | Beta: 0.97</span>+ <span>Session: {currentTime.toTimeString().substring(0, 8)}</span>+ <span style={{ color: BLOOMBERG_GREEN }}>SYSTEM: ACTIVE</span>+ </div>+ </div>+ </div>+ </div>+ );+};++export default AnalyticsTab;\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/tabs/ChatTab.tsx b/fincept-terminal-desktop/src/components/tabs/ChatTab.tsxnew file mode 100644index 000000000..e7d097ba4--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/ChatTab.tsx@@ -0,0 +1,747 @@+import React, { useState, useEffect, useRef } from 'react';+import { Send, Plus, Search, Trash2, RefreshCw, MessageSquare, User, Bot, Clock, Hash, CheckCircle, AlertCircle } from 'lucide-react';++interface Message {+ id: string;+ role: 'user' | 'assistant';+ content: string;+ timestamp: Date;+}++interface ChatSession {+ session_uuid: string;+ title: string;+ message_count: number;+ updated_at: string;+ created_at: string;+}++const ChatTab: React.FC = () => {+ const [currentTime, setCurrentTime] = useState(new Date());+ const [currentSessionUuid, setCurrentSessionUuid] = useState<string | null>(null);+ const [messages, setMessages] = useState<Message[]>([]);+ const [messageInput, setMessageInput] = useState('');+ const [sessionSearch, setSessionSearch] = useState('');+ const [isTyping, setIsTyping] = useState(false);+ const [chatCounter, setChatCounter] = useState(1);+ const [sessions, setSessions] = useState<ChatSession[]>([]);+ const [isConnected, setIsConnected] = useState(true);+ const [systemStatus, setSystemStatus] = useState('STATUS: READY');+ const [totalSessions, setTotalSessions] = useState(0);+ const [totalMessages, setTotalMessages] = useState(0);+ const [userType, setUserType] = useState('FREE');+ const [requestCount, setRequestCount] = useState(142);++ const messagesEndRef = useRef<HTMLDivElement>(null);++ // Bloomberg color scheme+ const BLOOMBERG_ORANGE = '#FFA500';+ const BLOOMBERG_WHITE = '#FFFFFF';+ const BLOOMBERG_RED = '#FF0000';+ const BLOOMBERG_GREEN = '#00C800';+ const BLOOMBERG_YELLOW = '#FFFF00';+ const BLOOMBERG_GRAY = '#787878';+ const BLOOMBERG_BLUE = '#64B4FF';+ const BLOOMBERG_DARK_BG = '#000000';+ const BLOOMBERG_PANEL_BG = '#0a0a0a';++ useEffect(() => {+ const timer = setInterval(() => {+ setCurrentTime(new Date());+ }, 1000);+ return () => clearInterval(timer);+ }, []);++ useEffect(() => {+ scrollToBottom();+ }, [messages]);++ useEffect(() => {+ // Simulate loading sessions+ const mockSessions: ChatSession[] = [+ {+ session_uuid: '1',+ title: 'Market Analysis Discussion',+ message_count: 12,+ updated_at: new Date(Date.now() - 3600000).toISOString(),+ created_at: new Date(Date.now() - 7200000).toISOString()+ },+ {+ session_uuid: '2',+ title: 'Portfolio Optimization Help',+ message_count: 8,+ updated_at: new Date(Date.now() - 7200000).toISOString(),+ created_at: new Date(Date.now() - 10800000).toISOString()+ },+ {+ session_uuid: '3',+ title: 'Technical Analysis Guide',+ message_count: 15,+ updated_at: new Date(Date.now() - 86400000).toISOString(),+ created_at: new Date(Date.now() - 172800000).toISOString()+ }+ ];+ setSessions(mockSessions);+ setTotalSessions(mockSessions.length);+ setTotalMessages(mockSessions.reduce((sum, session) => sum + session.message_count, 0));+ }, []);++ const scrollToBottom = () => {+ messagesEndRef.current?.scrollIntoView({ behavior: 'smooth' });+ };++ const handleSendMessage = () => {+ if (!messageInput.trim()) return;++ const userMessage: Message = {+ id: Date.now().toString(),+ role: 'user',+ content: messageInput.trim(),+ timestamp: new Date()+ };++ setMessages(prev => [...prev, userMessage]);+ setMessageInput('');+ setIsTyping(true);+ setSystemStatus('STATUS: SENDING MESSAGE...');++ // Simulate AI response+ setTimeout(() => {+ const aiMessage: Message = {+ id: (Date.now() + 1).toString(),+ role: 'assistant',+ content: generateAIResponse(userMessage.content),+ timestamp: new Date()+ };+ setMessages(prev => [...prev, aiMessage]);+ setIsTyping(false);+ setSystemStatus('STATUS: READY');+ setRequestCount(prev => prev + 1);+ }, 1500);+ };++ const generateAIResponse = (userInput: string): string => {+ const responses = [+ "I can help you with market analysis. Let me analyze the current market conditions and provide insights based on real-time data.",+ "Based on your portfolio composition, I recommend diversifying across different sectors to minimize risk while maximizing returns.",+ "The technical indicators suggest a bullish trend in the technology sector. Consider examining the RSI and MACD indicators for better entry points.",+ "For risk management, I suggest implementing stop-loss orders at 5-10% below your entry price depending on the volatility of the asset.",+ "Current market sentiment indicates increased volatility. It's advisable to reduce position sizes and focus on defensive stocks during this period."+ ];+ return responses[Math.floor(Math.random() * responses.length)];+ };++ const createNewSession = () => {+ const sessionTitle = messageInput.trim() ?+ generateSmartTitle(messageInput) :+ `Session-${chatCounter.toString().padStart(3, '0')}-${currentTime.getHours().toString().padStart(2, '0')}${currentTime.getMinutes().toString().padStart(2, '0')}`;++ const newSession: ChatSession = {+ session_uuid: Date.now().toString(),+ title: sessionTitle,+ message_count: 0,+ updated_at: new Date().toISOString(),+ created_at: new Date().toISOString()+ };++ setSessions(prev => [newSession, ...prev]);+ setCurrentSessionUuid(newSession.session_uuid);+ setMessages([]);+ setChatCounter(prev => prev + 1);+ setSystemStatus('STATUS: NEW SESSION CREATED');+ };++ const generateSmartTitle = (message: string): string => {+ const cleanMsg = message.replace(/[^\w\s]/g, '').trim();+ const words = cleanMsg.split(' ');++ if (words.length <= 2) {+ return cleanMsg.substring(0, 20) || 'New Chat';+ } else {+ return words.slice(0, 2).join(' ') + '...';+ }+ };++ const selectSession = (sessionUuid: string, title: string) => {+ setCurrentSessionUuid(sessionUuid);+ setSystemStatus('STATUS: LOADING SESSION...');++ // Simulate loading session messages+ setTimeout(() => {+ const mockMessages: Message[] = [+ {+ id: '1',+ role: 'user',+ content: 'Can you help me analyze the current market trends?',+ timestamp: new Date(Date.now() - 3600000)+ },+ {+ id: '2',+ role: 'assistant',+ content: 'I\'d be happy to help analyze current market trends. Based on recent data, we\'re seeing increased volatility in tech stocks while defensive sectors like utilities are showing stability.',+ timestamp: new Date(Date.now() - 3500000)+ }+ ];+ setMessages(mockMessages);+ setSystemStatus('STATUS: READY');+ }, 500);+ };++ const deleteSession = (sessionUuid: string) => {+ setSessions(prev => prev.filter(s => s.session_uuid !== sessionUuid));+ if (currentSessionUuid === sessionUuid) {+ setCurrentSessionUuid(null);+ setMessages([]);+ }+ setSystemStatus('STATUS: SESSION DELETED');+ };++ const clearCurrentChat = () => {+ setMessages([]);+ setSystemStatus('STATUS: CHAT CLEARED');+ };++ const filteredSessions = sessions.filter(session =>+ session.title.toLowerCase().includes(sessionSearch.toLowerCase())+ );++ const formatTime = (date: Date) => {+ return date.toLocaleTimeString('en-US', {+ hour12: false,+ hour: '2-digit',+ minute: '2-digit',+ second: '2-digit'+ });+ };++ const formatSessionTime = (dateString: string) => {+ const date = new Date(dateString);+ const now = new Date();+ const diffHours = Math.floor((now.getTime() - date.getTime()) / (1000 * 60 * 60));++ if (diffHours < 24) {+ return date.toLocaleTimeString('en-US', { hour12: false, hour: '2-digit', minute: '2-digit' });+ } else {+ return date.toLocaleDateString('en-US', { month: '2-digit', day: '2-digit' });+ }+ };++ const renderWelcomeScreen = () => (+ <div style={{+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'center',+ height: '100%',+ backgroundColor: BLOOMBERG_PANEL_BG+ }}>+ <div style={{ textAlign: 'center', padding: '40px' }}>+ <div style={{ color: BLOOMBERG_ORANGE, fontSize: '24px', fontWeight: 'bold', marginBottom: '8px' }}>+ FINCEPT AI ASSISTANT+ </div>+ <div style={{ color: BLOOMBERG_WHITE, fontSize: '16px', marginBottom: '24px' }}>+ Financial Intelligence System+ </div>++ <div style={{ display: 'flex', gap: '24px', justifyContent: 'center', marginBottom: '24px' }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>+ <CheckCircle size={16} color={BLOOMBERG_GREEN} />+ <span style={{ color: BLOOMBERG_GREEN, fontSize: '14px' }}>AI Ready</span>+ </div>+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>+ <CheckCircle size={16} color={BLOOMBERG_GREEN} />+ <span style={{ color: BLOOMBERG_GREEN, fontSize: '14px' }}>API Connected</span>+ </div>+ </div>++ <div style={{ color: userType === 'FREE' ? BLOOMBERG_YELLOW : BLOOMBERG_GREEN, fontSize: '14px', marginBottom: '24px' }}>+ Mode: {userType === 'FREE' ? 'Guest (Limited)' : 'Registered (Full Access)'}+ </div>++ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '14px', marginBottom: '12px' }}>+ Quick Start:+ </div>+ <div style={{ color: BLOOMBERG_WHITE, fontSize: '12px', textAlign: 'left', marginBottom: '24px' }}>+ <div>• Type message below and press Enter</div>+ <div>• Use function keys for quick actions</div>+ <div>• Browse sessions in left panel</div>+ </div>++ <button+ onClick={createNewSession}+ style={{+ backgroundColor: BLOOMBERG_ORANGE,+ color: 'black',+ border: 'none',+ padding: '12px 24px',+ fontSize: '14px',+ fontWeight: 'bold',+ borderRadius: '4px',+ cursor: 'pointer'+ }}+ >+ START CHAT+ </button>+ </div>+ </div>+ );++ const renderMessage = (message: Message) => (+ <div key={message.id} style={{ marginBottom: '8px' }}>+ <div style={{+ display: 'flex',+ justifyContent: message.role === 'user' ? 'flex-end' : 'flex-start',+ marginBottom: '4px'+ }}>+ <div style={{+ maxWidth: '450px',+ minWidth: '120px',+ backgroundColor: BLOOMBERG_PANEL_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ borderRadius: '4px',+ padding: '12px'+ }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px', marginBottom: '8px' }}>+ {message.role === 'user' ? (+ <User size={14} color={BLOOMBERG_YELLOW} />+ ) : (+ <Bot size={14} color={BLOOMBERG_ORANGE} />+ )}+ <span style={{+ color: message.role === 'user' ? BLOOMBERG_YELLOW : BLOOMBERG_ORANGE,+ fontSize: '12px',+ fontWeight: 'bold'+ }}>+ {message.role === 'user' ? 'YOU' : 'AI'}+ </span>+ <Clock size={12} color={BLOOMBERG_GRAY} />+ <span style={{ color: BLOOMBERG_GRAY, fontSize: '11px' }}>+ {formatTime(message.timestamp)}+ </span>+ </div>+ <div style={{ color: BLOOMBERG_WHITE, fontSize: '14px', lineHeight: '1.4' }}>+ {message.content}+ </div>+ </div>+ </div>+ </div>+ );++ return (+ <div style={{+ height: '100%',+ backgroundColor: BLOOMBERG_DARK_BG,+ color: BLOOMBERG_WHITE,+ fontFamily: 'Consolas, monospace',+ display: 'flex',+ flexDirection: 'column',+ fontSize: '12px'+ }}>+ {/* Terminal Header */}+ <div style={{+ backgroundColor: BLOOMBERG_PANEL_BG,+ borderBottom: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '8px 12px'+ }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '16px' }}>+ <span style={{ color: BLOOMBERG_ORANGE, fontWeight: 'bold' }}>FINCEPT</span>+ <span style={{ color: BLOOMBERG_WHITE }}>AI ASSISTANT</span>+ <span style={{ color: BLOOMBERG_GRAY }}>|</span>+ <span style={{ color: userType === 'FREE' ? BLOOMBERG_YELLOW : BLOOMBERG_GREEN }}>+ 👤 {userType === 'FREE' ? 'Guest Mode' : 'User Mode'}+ </span>+ <span style={{ color: BLOOMBERG_GRAY }}>|</span>+ <span style={{ color: BLOOMBERG_WHITE }}>+ {currentTime.toISOString().replace('T', ' ').substring(0, 19)}+ </span>+ </div>+ </div>++ {/* Function Keys */}+ <div style={{+ backgroundColor: BLOOMBERG_PANEL_BG,+ borderBottom: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '4px 8px'+ }}>+ <div style={{ display: 'flex', gap: '4px' }}>+ {[+ { key: 'F1:HELP', action: () => setMessageInput('I need help with using this AI assistant') },+ { key: 'F2:SESSIONS', action: () => document.getElementById('session-search')?.focus() },+ { key: 'F3:NEW', action: createNewSession },+ { key: 'F4:SEARCH', action: () => document.getElementById('session-search')?.focus() },+ { key: 'F5:CLEAR', action: clearCurrentChat },+ { key: 'F6:STATS', action: () => setSystemStatus(`STATS: Sessions: ${totalSessions}, Messages: ${totalMessages}`) }+ ].map(item => (+ <button+ key={item.key}+ onClick={item.action}+ style={{+ backgroundColor: BLOOMBERG_DARK_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ color: BLOOMBERG_WHITE,+ padding: '4px 8px',+ fontSize: '10px',+ height: '25px',+ cursor: 'pointer'+ }}+ >+ {item.key}+ </button>+ ))}+ </div>+ </div>++ {/* Main Content */}+ <div style={{ flex: 1, display: 'flex', overflow: 'hidden' }}>+ {/* Left Panel - Chat Sessions */}+ <div style={{+ width: '350px',+ backgroundColor: BLOOMBERG_PANEL_BG,+ borderRight: `1px solid ${BLOOMBERG_GRAY}`,+ display: 'flex',+ flexDirection: 'column'+ }}>+ <div style={{ padding: '12px' }}>+ <div style={{ color: BLOOMBERG_ORANGE, fontSize: '14px', fontWeight: 'bold', marginBottom: '12px' }}>+ CHAT SESSIONS+ </div>++ {/* Controls */}+ <div style={{ display: 'flex', gap: '8px', marginBottom: '12px' }}>+ <button+ onClick={createNewSession}+ style={{+ backgroundColor: BLOOMBERG_ORANGE,+ color: 'black',+ border: 'none',+ padding: '6px 12px',+ fontSize: '11px',+ fontWeight: 'bold',+ cursor: 'pointer'+ }}+ >+ NEW+ </button>+ <button+ onClick={() => setSystemStatus('STATUS: SESSIONS REFRESHED')}+ style={{+ backgroundColor: BLOOMBERG_DARK_BG,+ color: BLOOMBERG_WHITE,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '6px 12px',+ fontSize: '11px',+ cursor: 'pointer'+ }}+ >+ REFRESH+ </button>+ <button+ onClick={() => currentSessionUuid && deleteSession(currentSessionUuid)}+ style={{+ backgroundColor: BLOOMBERG_RED,+ color: BLOOMBERG_WHITE,+ border: 'none',+ padding: '6px 12px',+ fontSize: '11px',+ cursor: 'pointer'+ }}+ >+ DELETE+ </button>+ </div>++ {/* Search */}+ <input+ id="session-search"+ type="text"+ placeholder="Search sessions..."+ value={sessionSearch}+ onChange={(e) => setSessionSearch(e.target.value)}+ style={{+ width: '100%',+ backgroundColor: BLOOMBERG_DARK_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ color: BLOOMBERG_WHITE,+ padding: '8px',+ fontSize: '12px',+ marginBottom: '12px'+ }}+ />++ {/* Stats */}+ <div style={{ marginBottom: '12px' }}>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '12px', fontWeight: 'bold', marginBottom: '4px' }}>+ SESSION STATISTICS+ </div>+ <div style={{ color: BLOOMBERG_WHITE, fontSize: '11px' }}>Total Sessions: {totalSessions}</div>+ <div style={{ color: BLOOMBERG_WHITE, fontSize: '11px' }}>Total Messages: {totalMessages}</div>+ <div style={{ color: BLOOMBERG_WHITE, fontSize: '11px' }}>+ Active Session: {currentSessionUuid ? sessions.find(s => s.session_uuid === currentSessionUuid)?.title || 'None' : 'None'}+ </div>+ </div>++ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '12px', fontWeight: 'bold', marginBottom: '8px' }}>+ ACTIVE SESSIONS+ </div>+ </div>++ {/* Session List */}+ <div style={{ flex: 1, overflow: 'auto', padding: '0 12px 12px' }}>+ {filteredSessions.map(session => (+ <div+ key={session.session_uuid}+ style={{+ backgroundColor: currentSessionUuid === session.session_uuid ? BLOOMBERG_ORANGE + '20' : BLOOMBERG_DARK_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '8px',+ marginBottom: '4px',+ cursor: 'pointer'+ }}+ onClick={() => selectSession(session.session_uuid, session.title)}+ >+ <div style={{ color: BLOOMBERG_WHITE, fontSize: '12px', fontWeight: 'bold', marginBottom: '4px' }}>+ {session.title}+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>+ <div style={{ display: 'flex', gap: '12px' }}>+ <span style={{ color: BLOOMBERG_GRAY, fontSize: '10px' }}>+ Msgs: {session.message_count}+ </span>+ <span style={{ color: BLOOMBERG_GRAY, fontSize: '10px' }}>+ {formatSessionTime(session.updated_at)}+ </span>+ </div>+ <button+ onClick={(e) => {+ e.stopPropagation();+ deleteSession(session.session_uuid);+ }}+ style={{+ backgroundColor: 'transparent',+ color: BLOOMBERG_RED,+ border: 'none',+ fontSize: '10px',+ cursor: 'pointer',+ padding: '2px'+ }}+ >+ DEL+ </button>+ </div>+ </div>+ ))}+ </div>+ </div>++ {/* Center Panel - Chat Interface */}+ <div style={{+ width: '850px',+ backgroundColor: BLOOMBERG_PANEL_BG,+ borderRight: `1px solid ${BLOOMBERG_GRAY}`,+ display: 'flex',+ flexDirection: 'column'+ }}>+ {/* Chat Header */}+ <div style={{ padding: '12px' }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>+ <span style={{ color: BLOOMBERG_ORANGE, fontSize: '14px', fontWeight: 'bold' }}>AI CHAT</span>+ <span style={{ color: BLOOMBERG_GRAY }}>|</span>+ <span style={{ color: BLOOMBERG_WHITE, fontSize: '12px' }}>+ {currentSessionUuid ? sessions.find(s => s.session_uuid === currentSessionUuid)?.title || 'No Active Session' : 'No Active Session'}+ </span>+ </div>+ </div>++ {/* Messages Area */}+ <div style={{+ flex: 1,+ padding: '12px',+ overflow: 'auto',+ backgroundColor: BLOOMBERG_DARK_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ margin: '0 12px'+ }}>+ {messages.length === 0 ? renderWelcomeScreen() : (+ <div>+ {messages.map(renderMessage)}+ {isTyping && (+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px', color: BLOOMBERG_GRAY }}>+ <Bot size={14} />+ <span>AI is typing...</span>+ </div>+ )}+ <div ref={messagesEndRef} />+ </div>+ )}+ </div>++ {/* Input Area */}+ <div style={{ padding: '12px' }}>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '12px', fontWeight: 'bold', marginBottom: '8px' }}>+ INPUT+ </div>+ <div style={{ display: 'flex', gap: '8px' }}>+ <textarea+ value={messageInput}+ onChange={(e) => setMessageInput(e.target.value)}+ onKeyPress={(e) => {+ if (e.key === 'Enter' && !e.shiftKey) {+ e.preventDefault();+ handleSendMessage();+ }+ }}+ placeholder="Type message..."+ style={{+ flex: 1,+ backgroundColor: BLOOMBERG_DARK_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ color: BLOOMBERG_WHITE,+ padding: '8px',+ fontSize: '12px',+ resize: 'none',+ height: '40px'+ }}+ />+ <div style={{ display: 'flex', flexDirection: 'column', gap: '4px' }}>+ <button+ onClick={handleSendMessage}+ style={{+ backgroundColor: BLOOMBERG_ORANGE,+ color: 'black',+ border: 'none',+ padding: '8px 16px',+ fontSize: '11px',+ fontWeight: 'bold',+ cursor: 'pointer'+ }}+ >+ SEND+ </button>+ <button+ onClick={() => setMessageInput('')}+ style={{+ backgroundColor: BLOOMBERG_DARK_BG,+ color: BLOOMBERG_WHITE,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '6px 16px',+ fontSize: '10px',+ cursor: 'pointer'+ }}+ >+ CLEAR+ </button>+ </div>+ </div>+ <div style={{ color: BLOOMBERG_GRAY, fontSize: '11px', marginTop: '4px' }}>+ {messageInput.length > 0 ? `${messageInput.length} chars` : 'Ready'}+ </div>+ </div>+ </div>++ {/* Right Panel - Command Center */}+ <div style={{+ width: '300px',+ backgroundColor: BLOOMBERG_PANEL_BG,+ padding: '12px',+ overflow: 'auto'+ }}>+ <div style={{ color: BLOOMBERG_ORANGE, fontSize: '14px', fontWeight: 'bold', marginBottom: '12px' }}>+ COMMAND CENTER+ </div>++ {/* API Status */}+ <div style={{ marginBottom: '16px' }}>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '12px', fontWeight: 'bold', marginBottom: '8px' }}>+ API STATUS+ </div>+ <div style={{ color: BLOOMBERG_GREEN, fontSize: '11px', marginBottom: '2px' }}>+ ● Connected+ </div>+ <div style={{ color: BLOOMBERG_WHITE, fontSize: '11px', marginBottom: '2px' }}>+ ● {userType} User+ </div>+ <div style={{ color: BLOOMBERG_WHITE, fontSize: '11px' }}>+ ● Requests: {requestCount}+ </div>+ </div>++ {/* Quick Commands */}+ <div style={{ marginBottom: '16px' }}>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '12px', fontWeight: 'bold', marginBottom: '8px' }}>+ QUICK COMMANDS+ </div>+ {[+ { cmd: 'NEW_SESSION', desc: 'Create new chat session', action: createNewSession },+ { cmd: 'GET_HELP', desc: 'Get AI assistance', action: () => setMessageInput('I need help with using this AI assistant') },+ { cmd: 'MARKET_ANALYSIS', desc: 'Market insights', action: () => setMessageInput('Can you help me with market analysis?') },+ { cmd: 'PORTFOLIO_HELP', desc: 'Portfolio advice', action: () => setMessageInput('I need advice on portfolio management') }+ ].map(item => (+ <div key={item.cmd} style={{ marginBottom: '8px' }}>+ <button+ onClick={item.action}+ style={{+ width: '100%',+ backgroundColor: BLOOMBERG_DARK_BG,+ color: BLOOMBERG_WHITE,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '6px',+ fontSize: '10px',+ textAlign: 'left',+ cursor: 'pointer'+ }}+ >+ {item.cmd}+ </button>+ <div style={{ color: BLOOMBERG_GRAY, fontSize: '9px', padding: '2px 0' }}>+ {item.desc}+ </div>+ </div>+ ))}+ </div>++ {/* System Info */}+ <div>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '12px', fontWeight: 'bold', marginBottom: '8px' }}>+ SYSTEM INFO+ </div>+ <div style={{ color: BLOOMBERG_GREEN, fontSize: '11px', marginBottom: '2px' }}>+ Chat API: READY+ </div>+ <div style={{ color: BLOOMBERG_GREEN, fontSize: '11px', marginBottom: '2px' }}>+ Response Time: <100ms+ </div>+ <div style={{ color: BLOOMBERG_GRAY, fontSize: '11px', marginBottom: '2px' }}>+ Last Update:+ </div>+ <div style={{ color: BLOOMBERG_WHITE, fontSize: '11px' }}>+ {formatTime(currentTime)}+ </div>+ </div>+ </div>+ </div>++ {/* Status Bar */}+ <div style={{+ backgroundColor: BLOOMBERG_PANEL_BG,+ borderTop: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '6px 12px',+ display: 'flex',+ alignItems: 'center',+ gap: '16px',+ fontSize: '11px'+ }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '4px' }}>+ <div style={{ color: BLOOMBERG_GREEN }}>●</div>+ <span style={{ color: BLOOMBERG_GREEN }}>CONNECTED</span>+ </div>+ <span style={{ color: BLOOMBERG_GRAY }}>|</span>+ <span style={{ color: BLOOMBERG_ORANGE }}>AI CHAT</span>+ <span style={{ color: BLOOMBERG_GRAY }}>|</span>+ <span style={{ color: BLOOMBERG_WHITE }}>{systemStatus}</span>+ <span style={{ color: BLOOMBERG_GRAY }}>|</span>+ <span style={{ color: BLOOMBERG_WHITE }}>USER: {userType}</span>+ </div>+ </div>+ );+};++export default ChatTab;\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/tabs/CodeEditorTab.tsx b/fincept-terminal-desktop/src/components/tabs/CodeEditorTab.tsxnew file mode 100644index 000000000..082a197aa--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/CodeEditorTab.tsx@@ -0,0 +1,425 @@+import React, { useState, useRef } from 'react';+import { Play, Save, FileText, Plus, X, RefreshCw, Terminal as TerminalIcon, Download } from 'lucide-react';++interface EditorFile {+ id: string;+ name: string;+ content: string;+ language: 'finscript' | 'python' | 'javascript' | 'json';+ unsaved: boolean;+}++interface ExecutionResult {+ output: string;+ error?: string;+ timestamp: Date;+}++export default function CodeEditorTab() {+ const [editorMode, setEditorMode] = useState<'code' | 'notebook'>('code');+ const [files, setFiles] = useState<EditorFile[]>([+ {+ id: '1',+ name: 'strategy.fincept',+ content: `// FinScript - Financial Analysis Language+// Example: EMA/WMA Crossover Strategy++if ema(AAPL, 21) > wma(AAPL, 50) {+ buy "EMA 21 crosses WMA 50 - Buy Signal"+}++if ema(AAPL, 21) < wma(AAPL, 50) {+ sell "EMA 21 crosses below WMA 50 - Sell Signal"+}++plot ema(AAPL, 7), "EMA (7)"+plot wma(AAPL, 21), "WMA (21)"+plot_candlestick AAPL, "Apple Stock Chart"`,+ language: 'finscript',+ unsaved: false+ }+ ]);+ const [activeFileId, setActiveFileId] = useState('1');+ const [output, setOutput] = useState<ExecutionResult[]>([]);+ const [isRunning, setIsRunning] = useState(false);++ const textareaRef = useRef<HTMLTextAreaElement>(null);++ // Colors+ const C = {+ ORANGE: '#FF8C00',+ WHITE: '#FFFFFF',+ GREEN: '#00FF00',+ RED: '#FF0000',+ YELLOW: '#FFFF00',+ BLUE: '#4169E1',+ CYAN: '#00FFFF',+ GRAY: '#787878',+ DARK_BG: '#000000',+ PANEL_BG: '#0a0a0a',+ EDITOR_BG: '#1a1a1a'+ };++ const activeFile = files.find(f => f.id === activeFileId) || files[0];++ const updateFileContent = (content: string) => {+ setFiles(files.map(f =>+ f.id === activeFileId ? { ...f, content, unsaved: true } : f+ ));+ };++ const saveFile = () => {+ setFiles(files.map(f =>+ f.id === activeFileId ? { ...f, unsaved: false } : f+ ));+ setOutput([...output, {+ output: `File '${activeFile.name}' saved successfully`,+ timestamp: new Date()+ }]);+ };++ const createNewFile = () => {+ const newId = Date.now().toString();+ const newFile: EditorFile = {+ id: newId,+ name: `untitled-${files.length + 1}.fincept`,+ content: '// New FinScript file\n',+ language: 'finscript',+ unsaved: false+ };+ setFiles([...files, newFile]);+ setActiveFileId(newId);+ };++ const closeFile = (id: string) => {+ if (files.length === 1) return;+ const newFiles = files.filter(f => f.id !== id);+ setFiles(newFiles);+ if (activeFileId === id) {+ setActiveFileId(newFiles[0].id);+ }+ };++ const executeFinScript = async () => {+ setIsRunning(true);+ setOutput([...output, {+ output: `Executing FinScript: ${activeFile.name}...`,+ timestamp: new Date()+ }]);++ // Simulate execution (in production, this would call the Rust backend)+ setTimeout(() => {+ const mockOutput = `+=== FinScript Execution Results ===+File: ${activeFile.name}+Status: Completed Successfully++Fetching data for AAPL...+Calculating EMA(7), EMA(21), WMA(21), WMA(50)...++Signal Generated:+ ✓ BUY: EMA 21 crosses WMA 50 - Buy Signal++Chart Generated:+ ✓ Candlestick Chart: Apple Stock Chart+ ✓ Plot: EMA (7) - Current: 184.52+ ✓ Plot: WMA (21) - Current: 182.34++Execution Time: 1.24s+Memory Used: 2.4 MB+`;+ setOutput([...output, {+ output: mockOutput,+ timestamp: new Date()+ }]);+ setIsRunning(false);+ }, 1500);+ };++ const executePython = async () => {+ setIsRunning(true);+ setOutput([...output, {+ output: `Executing Python code...`,+ timestamp: new Date()+ }]);++ setTimeout(() => {+ const mockOutput = `+=== Python Execution Results ===+Hello from Python!+Numpy version: 1.24.3+Pandas version: 2.0.2++Successfully executed.+`;+ setOutput([...output, {+ output: mockOutput,+ timestamp: new Date()+ }]);+ setIsRunning(false);+ }, 1000);+ };++ const runCode = () => {+ if (activeFile.language === 'finscript') {+ executeFinScript();+ } else if (activeFile.language === 'python') {+ executePython();+ }+ };++ const clearOutput = () => setOutput([]);++ const getLanguageColor = (lang: string) => {+ switch (lang) {+ case 'finscript': return C.ORANGE;+ case 'python': return C.BLUE;+ case 'javascript': return C.YELLOW;+ default: return C.GRAY;+ }+ };++ return (+ <div style={{ width: '100%', height: '100%', backgroundColor: C.DARK_BG, color: C.WHITE, fontFamily: 'Consolas, monospace', display: 'flex', flexDirection: 'column' }}>+ <style>{`+ .code-scroll::-webkit-scrollbar { width: 8px; height: 8px; }+ .code-scroll::-webkit-scrollbar-track { background: #1a1a1a; }+ .code-scroll::-webkit-scrollbar-thumb { background: #404040; border-radius: 4px; }+ .code-scroll::-webkit-scrollbar-thumb:hover { background: #525252; }++ .code-editor {+ font-family: 'Consolas', 'Monaco', 'Courier New', monospace;+ font-size: 14px;+ line-height: 1.6;+ tab-size: 4;+ }++ .line-numbers {+ background: #0a0a0a;+ color: #787878;+ padding: 12px 8px;+ text-align: right;+ font-size: 13px;+ user-select: none;+ border-right: 1px solid #404040;+ }+ `}</style>++ {/* Header */}+ <div style={{ backgroundColor: C.PANEL_BG, borderBottom: `2px solid ${C.GRAY}`, padding: '8px 16px' }}>+ <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>+ <span style={{ color: C.ORANGE, fontWeight: 'bold', fontSize: '16px' }}>CODE EDITOR</span>+ <span style={{ color: C.GRAY }}>|</span>+ <button onClick={() => setEditorMode('code')} style={{ padding: '4px 12px', backgroundColor: editorMode === 'code' ? C.ORANGE : C.DARK_BG, border: `2px solid ${C.GRAY}`, color: editorMode === 'code' ? C.DARK_BG : C.WHITE, fontSize: '11px', fontWeight: 'bold', cursor: 'pointer', fontFamily: 'Consolas, monospace' }}>+ FINSCRIPT EDITOR+ </button>+ <button onClick={() => setEditorMode('notebook')} style={{ padding: '4px 12px', backgroundColor: editorMode === 'notebook' ? C.ORANGE : C.DARK_BG, border: `2px solid ${C.GRAY}`, color: editorMode === 'notebook' ? C.DARK_BG : C.WHITE, fontSize: '11px', fontWeight: 'bold', cursor: 'pointer', fontFamily: 'Consolas, monospace' }}>+ JUPYTER NOTEBOOK+ </button>+ </div>+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>+ <button onClick={createNewFile} style={{ padding: '6px 12px', backgroundColor: C.DARK_BG, border: `2px solid ${C.GREEN}`, color: C.GREEN, fontSize: '11px', fontWeight: 'bold', cursor: 'pointer', fontFamily: 'Consolas, monospace' }}>+ <Plus size={14} style={{ display: 'inline', marginRight: '4px' }} />NEW FILE+ </button>+ <button onClick={saveFile} disabled={!activeFile.unsaved} style={{ padding: '6px 12px', backgroundColor: C.DARK_BG, border: `2px solid ${activeFile.unsaved ? C.YELLOW : C.GRAY}`, color: activeFile.unsaved ? C.YELLOW : C.GRAY, fontSize: '11px', fontWeight: 'bold', cursor: activeFile.unsaved ? 'pointer' : 'not-allowed', fontFamily: 'Consolas, monospace' }}>+ <Save size={14} style={{ display: 'inline', marginRight: '4px' }} />SAVE+ </button>+ <button onClick={runCode} disabled={isRunning} style={{ padding: '6px 12px', backgroundColor: isRunning ? C.GRAY : C.GREEN, border: 'none', color: C.DARK_BG, fontSize: '11px', fontWeight: 'bold', cursor: isRunning ? 'not-allowed' : 'pointer', fontFamily: 'Consolas, monospace' }}>+ <Play size={14} style={{ display: 'inline', marginRight: '4px' }} />{isRunning ? 'RUNNING...' : 'RUN CODE'}+ </button>+ </div>+ </div>+ </div>++ {/* File Tabs */}+ <div style={{ backgroundColor: C.PANEL_BG, borderBottom: `1px solid ${C.GRAY}`, display: 'flex', alignItems: 'center', padding: '4px 8px', gap: '4px', overflowX: 'auto' }}>+ {files.map(file => (+ <div key={file.id} onClick={() => setActiveFileId(file.id)} style={{ display: 'flex', alignItems: 'center', gap: '6px', padding: '6px 12px', backgroundColor: activeFileId === file.id ? C.EDITOR_BG : C.DARK_BG, border: `1px solid ${activeFileId === file.id ? getLanguageColor(file.language) : C.GRAY}`, cursor: 'pointer', fontSize: '11px' }}>+ <FileText size={12} style={{ color: getLanguageColor(file.language) }} />+ <span style={{ color: file.unsaved ? C.YELLOW : C.WHITE }}>{file.name}{file.unsaved && '*'}</span>+ {files.length > 1 && (+ <X size={12} onClick={(e) => { e.stopPropagation(); closeFile(file.id); }} style={{ color: C.GRAY, cursor: 'pointer' }} />+ )}+ </div>+ ))}+ </div>++ {/* Main Content */}+ <div style={{ flex: 1, display: 'flex', minHeight: 0 }}>+ {editorMode === 'code' ? (+ <>+ {/* Editor Panel */}+ <div style={{ flex: 1, display: 'flex', flexDirection: 'column', borderRight: `1px solid ${C.GRAY}` }}>+ <div style={{ backgroundColor: C.PANEL_BG, padding: '8px 12px', borderBottom: `1px solid ${C.GRAY}`, display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>+ <span style={{ color: C.ORANGE, fontSize: '12px', fontWeight: 'bold' }}>EDITOR</span>+ <span style={{ color: C.GRAY }}>|</span>+ <span style={{ color: getLanguageColor(activeFile.language), fontSize: '11px' }}>{activeFile.language.toUpperCase()}</span>+ </div>+ <div style={{ fontSize: '10px', color: C.GRAY }}>+ Lines: {activeFile.content.split('\n').length} | Chars: {activeFile.content.length}+ </div>+ </div>++ <div style={{ flex: 1, display: 'flex', overflow: 'hidden' }}>+ {/* Line Numbers */}+ <div className="line-numbers">+ {activeFile.content.split('\n').map((_, i) => (+ <div key={i}>{i + 1}</div>+ ))}+ </div>++ {/* Editor */}+ <textarea+ ref={textareaRef}+ className="code-editor code-scroll"+ value={activeFile.content}+ onChange={(e) => updateFileContent(e.target.value)}+ spellCheck={false}+ style={{+ flex: 1,+ backgroundColor: C.EDITOR_BG,+ color: C.WHITE,+ border: 'none',+ outline: 'none',+ resize: 'none',+ padding: '12px',+ whiteSpace: 'pre',+ overflowWrap: 'normal',+ overflowX: 'auto'+ }}+ />+ </div>+ </div>++ {/* Output Panel */}+ <div style={{ width: '450px', display: 'flex', flexDirection: 'column', backgroundColor: C.PANEL_BG }}>+ <div style={{ backgroundColor: C.DARK_BG, padding: '8px 12px', borderBottom: `1px solid ${C.GRAY}`, display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>+ <TerminalIcon size={14} style={{ color: C.GREEN }} />+ <span style={{ color: C.ORANGE, fontSize: '12px', fontWeight: 'bold' }}>OUTPUT CONSOLE</span>+ </div>+ <button onClick={clearOutput} style={{ padding: '3px 8px', backgroundColor: 'transparent', border: `1px solid ${C.RED}`, color: C.RED, fontSize: '9px', cursor: 'pointer', fontFamily: 'Consolas, monospace' }}>+ CLEAR+ </button>+ </div>++ <div className="code-scroll" style={{ flex: 1, overflowY: 'auto', padding: '12px', backgroundColor: C.DARK_BG, fontSize: '12px', lineHeight: '1.6' }}>+ {output.length === 0 ? (+ <div style={{ color: C.GRAY, textAlign: 'center', paddingTop: '40px' }}>+ <TerminalIcon size={32} style={{ marginBottom: '8px', opacity: 0.5 }} />+ <div>No output yet</div>+ <div style={{ fontSize: '10px', marginTop: '4px' }}>Run your code to see results</div>+ </div>+ ) : (+ output.map((result, idx) => (+ <div key={idx} style={{ marginBottom: '16px', paddingBottom: '16px', borderBottom: `1px solid ${C.GRAY}` }}>+ <div style={{ color: C.CYAN, fontSize: '10px', marginBottom: '6px' }}>+ [{result.timestamp.toLocaleTimeString()}]+ </div>+ <pre style={{ color: result.error ? C.RED : C.GREEN, margin: 0, whiteSpace: 'pre-wrap', wordBreak: 'break-word' }}>+ {result.error || result.output}+ </pre>+ </div>+ ))+ )}+ </div>+ </div>+ </>+ ) : (+ // Jupyter Notebook Mode+ <div style={{ flex: 1, display: 'flex', flexDirection: 'column' }}>+ <div style={{ backgroundColor: C.PANEL_BG, padding: '12px', borderBottom: `1px solid ${C.GRAY}` }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>+ <span style={{ color: C.ORANGE, fontSize: '12px', fontWeight: 'bold' }}>JUPYTER NOTEBOOK</span>+ <div style={{ display: 'flex', gap: '8px' }}>+ <button style={{ padding: '6px 12px', backgroundColor: C.DARK_BG, border: `2px solid ${C.BLUE}`, color: C.BLUE, fontSize: '11px', fontWeight: 'bold', cursor: 'pointer', fontFamily: 'Consolas, monospace' }}>+ <Plus size={14} style={{ display: 'inline', marginRight: '4px' }} />ADD CELL+ </button>+ <button style={{ padding: '6px 12px', backgroundColor: C.GREEN, border: 'none', color: C.DARK_BG, fontSize: '11px', fontWeight: 'bold', cursor: 'pointer', fontFamily: 'Consolas, monospace' }}>+ <Play size={14} style={{ display: 'inline', marginRight: '4px' }} />RUN ALL+ </button>+ </div>+ </div>+ </div>++ <div className="code-scroll" style={{ flex: 1, overflowY: 'auto', padding: '16px', backgroundColor: '#050505' }}>+ <div style={{ maxWidth: '1200px', margin: '0 auto' }}>+ {/* Cell 1 */}+ <div style={{ backgroundColor: C.PANEL_BG, border: `1px solid ${C.GRAY}`, marginBottom: '16px' }}>+ <div style={{ backgroundColor: C.DARK_BG, padding: '6px 12px', borderBottom: `1px solid ${C.GRAY}`, fontSize: '10px', color: C.BLUE }}>+ In [1]: Python Code+ </div>+ <textarea+ placeholder="import pandas as pd import numpy as np # Your Python code here..."+ style={{+ width: '100%',+ minHeight: '120px',+ backgroundColor: C.EDITOR_BG,+ color: C.WHITE,+ border: 'none',+ outline: 'none',+ resize: 'vertical',+ padding: '12px',+ fontSize: '13px',+ fontFamily: 'Consolas, monospace'+ }}+ />+ <div style={{ backgroundColor: C.DARK_BG, padding: '12px', borderTop: `1px solid ${C.GRAY}` }}>+ <div style={{ color: C.GREEN, fontSize: '10px', marginBottom: '4px' }}>Output:</div>+ <div style={{ color: C.GRAY, fontSize: '11px', fontStyle: 'italic' }}>Execute cell to see output</div>+ </div>+ </div>++ {/* Cell 2 */}+ <div style={{ backgroundColor: C.PANEL_BG, border: `1px solid ${C.GRAY}`, marginBottom: '16px' }}>+ <div style={{ backgroundColor: C.DARK_BG, padding: '6px 12px', borderBottom: `1px solid ${C.GRAY}`, fontSize: '10px', color: C.BLUE }}>+ In [2]: Data Analysis+ </div>+ <textarea+ placeholder="# Financial data analysis # Use pandas, matplotlib, seaborn..."+ style={{+ width: '100%',+ minHeight: '120px',+ backgroundColor: C.EDITOR_BG,+ color: C.WHITE,+ border: 'none',+ outline: 'none',+ resize: 'vertical',+ padding: '12px',+ fontSize: '13px',+ fontFamily: 'Consolas, monospace'+ }}+ />+ </div>++ <div style={{ textAlign: 'center', padding: '20px' }}>+ <button style={{ padding: '8px 16px', backgroundColor: C.DARK_BG, border: `2px dashed ${C.GRAY}`, color: C.GRAY, fontSize: '11px', cursor: 'pointer', fontFamily: 'Consolas, monospace' }}>+ + Add New Cell+ </button>+ </div>+ </div>+ </div>+ </div>+ )}+ </div>++ {/* Footer */}+ <div style={{ borderTop: `2px solid ${C.ORANGE}`, backgroundColor: C.PANEL_BG, padding: '8px 16px', fontSize: '11px' }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '16px' }}>+ <span style={{ color: C.ORANGE, fontWeight: 'bold' }}>FINCEPT CODE EDITOR v1.0</span>+ <span style={{ color: C.GRAY }}>|</span>+ <span style={{ color: C.CYAN }}>FinScript Language Support</span>+ <span style={{ color: C.GRAY }}>|</span>+ <span style={{ color: C.BLUE }}>Jupyter Integration</span>+ </div>+ <div style={{ color: C.GRAY }}>+ Mode: <span style={{ color: C.ORANGE, fontWeight: 'bold' }}>{editorMode.toUpperCase()}</span> | Files: {files.length}+ </div>+ </div>+ </div>+ </div>+ );+}\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/tabs/DBnomicsTab.tsx b/fincept-terminal-desktop/src/components/tabs/DBnomicsTab.tsxnew file mode 100644index 000000000..6fd8c1f70--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/DBnomicsTab.tsx@@ -0,0 +1,754 @@+import React, { useState } from 'react';+import { RefreshCw, Download, Plus, Minus, Trash2 } from 'lucide-react';++interface Provider {+ code: string;+ name: string;+}++interface Dataset {+ code: string;+ name: string;+}++interface Series {+ code: string;+ name: string;+ full_id: string;+}++interface Observation {+ period: string;+ value: number;+}++interface DataPoint {+ series_id: string;+ series_name: string;+ observations: Observation[];+ color: string;+}++type ChartType = 'line' | 'bar' | 'area' | 'scatter' | 'candlestick';++export default function DBnomicsTab() {+ const BASE_URL = 'https://api.db.nomics.world/v22';+ const COLORS = ['#ea580c', '#3b82f6', '#10b981', '#f59e0b', '#ec4899', '#8b5cf6', '#14b8a6', '#f97316'];++ const [providers, setProviders] = useState<Provider[]>([]);+ const [datasets, setDatasets] = useState<Dataset[]>([]);+ const [seriesList, setSeriesList] = useState<Series[]>([]);+ const [currentData, setCurrentData] = useState<DataPoint | null>(null);++ const [selectedProvider, setSelectedProvider] = useState<string | null>(null);+ const [selectedDataset, setSelectedDataset] = useState<string | null>(null);+ const [selectedSeries, setSelectedSeries] = useState<string | null>(null);++ const [status, setStatus] = useState('Loading providers...');+ const [loading, setLoading] = useState(false);++ const [slots, setSlots] = useState<DataPoint[][]>([[]]); // Array of slot arrays (each slot can have multiple series)+ const [slotChartTypes, setSlotChartTypes] = useState<ChartType[]>(['line']);+ const [activeView, setActiveView] = useState<'single' | 'comparison'>('single');+ const [singleViewSeries, setSingleViewSeries] = useState<DataPoint[]>([]);+ const [singleChartType, setSingleChartType] = useState<ChartType>('line');++ // Load providers on mount+ React.useEffect(() => {+ loadProviders();+ }, []);++ // API Functions+ const loadProviders = async () => {+ try {+ setLoading(true);+ setStatus('Loading providers...');+ const response = await fetch(`${BASE_URL}/providers`);+ if (response.ok) {+ const data = await response.json();+ const providerList: Provider[] = (data?.providers?.docs || []).map((p: any) => ({+ code: p.code || '',+ name: p.name || p.code || ''+ }));+ setProviders(providerList);+ setStatus(`Loaded ${providerList.length} providers`);+ } else {+ setStatus(`Error: ${response.status}`);+ }+ } catch (error) {+ setStatus(`Error: ${error}`);+ } finally {+ setLoading(false);+ }+ };++ const loadDatasets = async (providerCode: string) => {+ try {+ setLoading(true);+ setStatus(`Loading datasets...`);+ const response = await fetch(`${BASE_URL}/datasets/${providerCode}`);+ if (response.ok) {+ const data = await response.json();+ const datasetList: Dataset[] = (data?.datasets?.docs || []).map((d: any) => ({+ code: d.code || '',+ name: d.name || d.code || ''+ }));+ setDatasets(datasetList);+ setSeriesList([]);+ setStatus(`Loaded ${datasetList.length} datasets`);+ } else {+ setStatus(`Error: ${response.status}`);+ }+ } catch (error) {+ setStatus(`Error: ${error}`);+ } finally {+ setLoading(false);+ }+ };++ const loadSeries = async (providerCode: string, datasetCode: string) => {+ try {+ setLoading(true);+ setStatus(`Loading series...`);+ const response = await fetch(`${BASE_URL}/series/${providerCode}/${datasetCode}?limit=50&observations=false`);+ if (response.ok) {+ const data = await response.json();+ const seriesArray: Series[] = (data?.series?.docs || []).map((s: any) => ({+ code: s.series_code || '',+ name: s.series_name || s.series_code || '',+ full_id: `${providerCode}/${datasetCode}/${s.series_code}`+ }));+ setSeriesList(seriesArray);+ setStatus(`Loaded ${seriesArray.length} series`);+ } else {+ setStatus(`Error: ${response.status}`);+ }+ } catch (error) {+ setStatus(`Error: ${error}`);+ } finally {+ setLoading(false);+ }+ };++ const loadSeriesData = async (fullSeriesId: string, seriesName: string) => {+ try {+ setLoading(true);+ setStatus(`Loading data...`);+ const [providerCode, datasetCode, seriesCode] = fullSeriesId.split('/');+ const response = await fetch(`${BASE_URL}/series/${providerCode}/${datasetCode}/${seriesCode}?observations=1&format=json`);+ if (response.ok) {+ const data = await response.json();+ const seriesDocs = data?.series?.docs || [];+ if (seriesDocs.length > 0) {+ const firstSeries = seriesDocs[0];+ let observations: Observation[] = [];+ if (firstSeries.period && firstSeries.value) {+ for (let i = 0; i < Math.min(firstSeries.period.length, firstSeries.value.length); i++) {+ if (firstSeries.value[i] !== null) {+ observations.push({ period: firstSeries.period[i], value: firstSeries.value[i] });+ }+ }+ }+ if (observations.length > 0) {+ const colorIndex = (singleViewSeries.length + slots.flat().length) % COLORS.length;+ setCurrentData({ series_id: fullSeriesId, series_name: seriesName, observations, color: COLORS[colorIndex] });+ setStatus(`Loaded ${observations.length} points`);+ } else {+ setStatus('No data found');+ }+ } else {+ setStatus('No data found');+ }+ } else {+ setStatus(`Error: ${response.status}`);+ }+ } catch (error) {+ setStatus(`Error: ${error}`);+ } finally {+ setLoading(false);+ }+ };++ const handleProviderSelect = (providerCode: string) => {+ setSelectedProvider(providerCode);+ setSelectedDataset(null);+ setSelectedSeries(null);+ setDatasets([]);+ setSeriesList([]);+ loadDatasets(providerCode);+ };++ const handleDatasetSelect = (datasetCode: string) => {+ setSelectedDataset(datasetCode);+ setSelectedSeries(null);+ setSeriesList([]);+ if (selectedProvider) loadSeries(selectedProvider, datasetCode);+ };++ const handleSeriesSelect = (series: Series) => {+ setSelectedSeries(series.full_id);+ loadSeriesData(series.full_id, series.name);+ };++ // Slot Management+ const addSlot = () => {+ setSlots([...slots, []]);+ setSlotChartTypes([...slotChartTypes, 'line']);+ setStatus(`Added slot ${slots.length + 1}`);+ };++ const removeSlot = (index: number) => {+ if (slots.length > 1) {+ setSlots(slots.filter((_, i) => i !== index));+ setSlotChartTypes(slotChartTypes.filter((_, i) => i !== index));+ setStatus(`Removed slot ${index + 1}`);+ }+ };++ const addToSlot = (slotIndex: number) => {+ if (currentData && slotIndex >= 0 && slotIndex < slots.length) {+ const newSlots = [...slots];+ newSlots[slotIndex] = [...newSlots[slotIndex], currentData];+ setSlots(newSlots);+ setStatus(`Added to slot ${slotIndex + 1}`);+ }+ };++ const removeFromSlot = (slotIndex: number, seriesIndex: number) => {+ const newSlots = [...slots];+ newSlots[slotIndex] = newSlots[slotIndex].filter((_, i) => i !== seriesIndex);+ setSlots(newSlots);+ setStatus(`Removed from slot ${slotIndex + 1}`);+ };++ const addToSingleView = () => {+ if (currentData) {+ setSingleViewSeries([...singleViewSeries, currentData]);+ setStatus('Added to single view');+ }+ };++ const removeFromSingleView = (index: number) => {+ setSingleViewSeries(singleViewSeries.filter((_, i) => i !== index));+ };++ const clearAllSlots = () => {+ setSlots([[]]);+ setSlotChartTypes(['line']);+ setSingleViewSeries([]);+ setStatus('Cleared all');+ };++ const exportData = () => {+ if (!currentData) return;+ const csv = ['Period,Value', ...currentData.observations.map(obs => `${obs.period},${obs.value}`)].join('\n');+ const blob = new Blob([csv], { type: 'text/csv' });+ const url = URL.createObjectURL(blob);+ const a = document.createElement('a');+ a.href = url;+ a.download = `dbnomics_${Date.now()}.csv`;+ a.click();+ URL.revokeObjectURL(url);+ setStatus('Exported');+ };++ // Chart Rendering+ const renderChart = (seriesArray: DataPoint[], chartType: ChartType, compact = false) => {+ if (seriesArray.length === 0) return null;++ const w = compact ? '100%' : 800;+ const h = compact ? 240 : 400;+ const ml = 60;+ const mr = 20;+ const mt = 20;+ const mb = 50;++ // For compact view, calculate width dynamically+ const actualWidth = compact ? 380 : 800;+ const pw = actualWidth - ml - mr;+ const ph = h - mt - mb;++ // Aggregate all observations+ const allValues = seriesArray.flatMap(s => s.observations.map(o => o.value));+ const yMin = Math.min(...allValues) * 0.9;+ const yMax = Math.max(...allValues) * 1.1;+ const yRange = yMax - yMin;++ return (+ <svg width={w} height={h} viewBox={`0 0 ${actualWidth} ${h}`} preserveAspectRatio="xMidYMid meet" style={{ backgroundColor: '#0a0a0a', width: '100%', height: 'auto', maxHeight: compact ? '240px' : '400px' }}>+ {/* Axes */}+ <line x1={ml} y1={mt} x2={ml} y2={h - mb} stroke="#404040" strokeWidth="1" />+ <line x1={ml} y1={h - mb} x2={actualWidth - mr} y2={h - mb} stroke="#404040" strokeWidth="1" />++ {/* Y-axis grid and labels */}+ {[0, 1, 2, 3, 4].map(i => {+ const val = yMin + (yRange * i) / 4;+ const y = h - mb - (ph * i) / 4;+ return (+ <g key={i}>+ <line x1={ml} y1={y} x2={actualWidth - mr} y2={y} stroke="#1a1a1a" strokeDasharray="2,2" />+ <text x={ml - 8} y={y + 3} textAnchor="end" fill="#737373" fontSize="9" fontFamily="monospace">+ {val.toFixed(1)}+ </text>+ </g>+ );+ })}++ {/* Render each series */}+ {seriesArray.map((series, sIdx) => {+ const sorted = [...series.observations].sort((a, b) => new Date(a.period).getTime() - new Date(b.period).getTime());++ return (+ <g key={sIdx}>+ {sorted.map((obs, idx) => {+ const x = ml + (pw * idx) / (sorted.length - 1 || 1);+ const y = h - mb - (ph * ((obs.value - yMin) / yRange));+ const barWidth = pw / sorted.length * 0.8;++ if (chartType === 'line' || chartType === 'area') {+ return (+ <g key={idx}>+ {chartType === 'area' && idx === 0 && (+ <polygon+ points={sorted.map((o, i) => {+ const xi = ml + (pw * i) / (sorted.length - 1 || 1);+ const yi = h - mb - (ph * ((o.value - yMin) / yRange));+ return `${xi},${yi}`;+ }).join(' ') + ` ${w - mr},${h - mb} ${ml},${h - mb}`}+ fill={series.color}+ opacity="0.2"+ />+ )}+ <circle cx={x} cy={y} r="2" fill={series.color} />+ {idx < sorted.length - 1 && (+ <line+ x1={x}+ y1={y}+ x2={ml + (pw * (idx + 1)) / (sorted.length - 1 || 1)}+ y2={h - mb - (ph * ((sorted[idx + 1].value - yMin) / yRange))}+ stroke={series.color}+ strokeWidth="1.5"+ />+ )}+ </g>+ );+ } else if (chartType === 'bar') {+ return (+ <rect+ key={idx}+ x={x - barWidth / 2 + (sIdx * barWidth / seriesArray.length)}+ y={y}+ width={barWidth / seriesArray.length}+ height={h - mb - y}+ fill={series.color}+ opacity="0.8"+ />+ );+ } else if (chartType === 'scatter') {+ return <circle key={idx} cx={x} cy={y} r="3" fill={series.color} opacity="0.7" />;+ } else if (chartType === 'candlestick') {+ const nextObs = sorted[idx + 1];+ const open = obs.value;+ const close = nextObs ? nextObs.value : obs.value;+ const high = Math.max(open, close);+ const low = Math.min(open, close);+ const yHigh = h - mb - (ph * ((high - yMin) / yRange));+ const yLow = h - mb - (ph * ((low - yMin) / yRange));+ const yOpen = h - mb - (ph * ((open - yMin) / yRange));+ const yClose = h - mb - (ph * ((close - yMin) / yRange));++ return (+ <g key={idx}>+ <line x1={x} y1={yHigh} x2={x} y2={yLow} stroke={series.color} strokeWidth="1" />+ <rect+ x={x - 3}+ y={Math.min(yOpen, yClose)}+ width={6}+ height={Math.abs(yClose - yOpen) || 1}+ fill={close >= open ? '#10b981' : '#ef4444'}+ />+ </g>+ );+ }+ return null;+ })}+ </g>+ );+ })}++ {/* X-axis labels */}+ {seriesArray[0] && seriesArray[0].observations.slice().sort((a, b) => new Date(a.period).getTime() - new Date(b.period).getTime()).map((obs, idx, arr) => {+ if (idx % Math.max(1, Math.floor(arr.length / 6)) !== 0 && idx !== arr.length - 1) return null;+ const x = ml + (pw * idx) / (arr.length - 1 || 1);+ return (+ <text key={idx} x={x} y={h - mb + 15} textAnchor="middle" fill="#737373" fontSize="8" fontFamily="monospace">+ {obs.period.substring(0, 7)}+ </text>+ );+ })}++ {/* Legend */}+ {seriesArray.map((series, idx) => (+ <g key={idx}>+ <rect x={ml + idx * 120} y={5} width={10} height={10} fill={series.color} />+ <text x={ml + idx * 120 + 15} y={13} fill="#d4d4d4" fontSize="9" fontFamily="monospace">+ {series.series_name.substring(0, 12)}+ </text>+ </g>+ ))}+ </svg>+ );+ };++ return (+ <div style={{ width: '100%', height: '100%', backgroundColor: '#000', color: '#d4d4d4', fontFamily: 'Consolas, monospace', fontSize: '11px', overflow: 'hidden', display: 'flex', flexDirection: 'column' }}>+ <style>{`+ /* Custom scrollbar styles */+ *::-webkit-scrollbar {+ width: 8px;+ height: 8px;+ }+ *::-webkit-scrollbar-track {+ background: #1a1a1a;+ }+ *::-webkit-scrollbar-thumb {+ background: #404040;+ border-radius: 4px;+ }+ *::-webkit-scrollbar-thumb:hover {+ background: #525252;+ }+ `}</style>+ {/* Header */}+ <div style={{ padding: '8px 12px', borderBottom: '1px solid #404040', display: 'flex', alignItems: 'center', gap: '12px', flexWrap: 'wrap' }}>+ <span style={{ color: '#ea580c', fontWeight: 'bold' }}>DBNOMICS TERMINAL</span>+ <span style={{ color: '#0f0', fontSize: '10px' }}>● {status}</span>+ <span style={{ color: '#fbbf24', fontSize: '10px' }}>Providers: {providers.length}</span>+ <div style={{ flex: 1 }}></div>+ <button onClick={loadProviders} disabled={loading} style={{ padding: '3px 10px', backgroundColor: '#2d2d2d', color: '#d4d4d4', border: '1px solid #404040', cursor: loading ? 'not-allowed' : 'pointer', fontSize: '9px' }}>+ LOAD+ </button>+ <button onClick={() => currentData && loadSeriesData(currentData.series_id, currentData.series_name)} disabled={!currentData} style={{ padding: '3px 10px', backgroundColor: '#2d2d2d', color: '#d4d4d4', border: '1px solid #404040', cursor: !currentData ? 'not-allowed' : 'pointer', fontSize: '9px' }}>+ <RefreshCw size={10} style={{ display: 'inline', marginRight: '4px' }} />REFRESH+ </button>+ <button onClick={exportData} disabled={!currentData} style={{ padding: '3px 10px', backgroundColor: '#2d2d2d', color: '#d4d4d4', border: '1px solid #404040', cursor: !currentData ? 'not-allowed' : 'pointer', fontSize: '9px' }}>+ <Download size={10} style={{ display: 'inline', marginRight: '4px' }} />EXPORT+ </button>+ </div>++ {/* Main Content */}+ <div style={{ flex: 1, display: 'flex', overflow: 'hidden' }}>+ {/* Left Panel */}+ <div style={{ width: '320px', borderRight: '1px solid #404040', display: 'flex', flexDirection: 'column', backgroundColor: '#0a0a0a' }}>+ <div style={{ flex: 1, overflowY: 'auto', overflowX: 'hidden', padding: '8px' }}>+ <div style={{ color: '#ea580c', fontSize: '10px', marginBottom: '4px' }}>1. PROVIDER</div>+ <div+ style={{+ width: '100%',+ height: '140px',+ backgroundColor: '#1a1a1a',+ border: '1px solid #404040',+ marginBottom: '12px',+ overflowY: 'auto',+ overflowX: 'hidden',+ scrollbarWidth: 'thin',+ scrollbarColor: '#404040 #1a1a1a'+ }}+ >+ {providers.map(p => (+ <div+ key={p.code}+ onClick={() => handleProviderSelect(p.code)}+ style={{+ padding: '6px 8px',+ fontSize: '10px',+ color: selectedProvider === p.code ? '#fff' : '#d4d4d4',+ backgroundColor: selectedProvider === p.code ? '#ea580c' : 'transparent',+ cursor: 'pointer',+ fontFamily: 'Consolas, monospace',+ lineHeight: '1.4',+ wordWrap: 'break-word',+ whiteSpace: 'normal',+ borderBottom: '1px solid #0a0a0a'+ }}+ onMouseEnter={(e) => {+ if (selectedProvider !== p.code) {+ e.currentTarget.style.backgroundColor = '#2d2d2d';+ }+ }}+ onMouseLeave={(e) => {+ if (selectedProvider !== p.code) {+ e.currentTarget.style.backgroundColor = 'transparent';+ }+ }}+ >+ {p.code} - {p.name}+ </div>+ ))}+ </div>++ <div style={{ color: '#ea580c', fontSize: '10px', marginBottom: '4px' }}>2. DATASET</div>+ <div+ style={{+ width: '100%',+ height: '140px',+ backgroundColor: '#1a1a1a',+ border: '1px solid #404040',+ marginBottom: '12px',+ overflowY: 'auto',+ overflowX: 'hidden',+ scrollbarWidth: 'thin',+ scrollbarColor: '#404040 #1a1a1a'+ }}+ >+ {datasets.map(d => (+ <div+ key={d.code}+ onClick={() => handleDatasetSelect(d.code)}+ style={{+ padding: '6px 8px',+ fontSize: '10px',+ color: selectedDataset === d.code ? '#fff' : '#d4d4d4',+ backgroundColor: selectedDataset === d.code ? '#ea580c' : 'transparent',+ cursor: 'pointer',+ fontFamily: 'Consolas, monospace',+ lineHeight: '1.4',+ wordWrap: 'break-word',+ whiteSpace: 'normal',+ borderBottom: '1px solid #0a0a0a'+ }}+ onMouseEnter={(e) => {+ if (selectedDataset !== d.code) {+ e.currentTarget.style.backgroundColor = '#2d2d2d';+ }+ }}+ onMouseLeave={(e) => {+ if (selectedDataset !== d.code) {+ e.currentTarget.style.backgroundColor = 'transparent';+ }+ }}+ >+ {d.code} - {d.name}+ </div>+ ))}+ </div>++ <div style={{ color: '#ea580c', fontSize: '10px', marginBottom: '4px' }}>3. SERIES</div>+ <div+ style={{+ width: '100%',+ height: '140px',+ backgroundColor: '#1a1a1a',+ border: '1px solid #404040',+ marginBottom: '12px',+ overflowY: 'auto',+ overflowX: 'hidden',+ scrollbarWidth: 'thin',+ scrollbarColor: '#404040 #1a1a1a'+ }}+ >+ {seriesList.map(s => (+ <div+ key={s.full_id}+ onClick={() => handleSeriesSelect(s)}+ style={{+ padding: '6px 8px',+ fontSize: '10px',+ color: selectedSeries === s.full_id ? '#fff' : '#d4d4d4',+ backgroundColor: selectedSeries === s.full_id ? '#ea580c' : 'transparent',+ cursor: 'pointer',+ fontFamily: 'Consolas, monospace',+ lineHeight: '1.4',+ wordWrap: 'break-word',+ whiteSpace: 'normal',+ borderBottom: '1px solid #0a0a0a'+ }}+ onMouseEnter={(e) => {+ if (selectedSeries !== s.full_id) {+ e.currentTarget.style.backgroundColor = '#2d2d2d';+ }+ }}+ onMouseLeave={(e) => {+ if (selectedSeries !== s.full_id) {+ e.currentTarget.style.backgroundColor = 'transparent';+ }+ }}+ >+ {s.code} - {s.name}+ </div>+ ))}+ </div>++ <div style={{ height: '1px', backgroundColor: '#404040', margin: '8px 0' }}></div>++ {/* Actions */}+ <div style={{ display: 'flex', gap: '4px', marginBottom: '8px' }}>+ <button onClick={addToSingleView} disabled={!currentData} style={{ flex: 1, padding: '4px', backgroundColor: '#1a1a1a', color: '#d4d4d4', border: '1px solid #404040', cursor: !currentData ? 'not-allowed' : 'pointer', fontSize: '9px' }}>+ ADD TO SINGLE+ </button>+ <button onClick={clearAllSlots} style={{ padding: '4px 8px', backgroundColor: '#1a1a1a', color: '#ef4444', border: '1px solid #404040', cursor: 'pointer', fontSize: '9px' }}>+ <Trash2 size={10} />+ </button>+ </div>++ <div style={{ color: '#ea580c', fontSize: '10px', marginBottom: '6px', display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>+ <span>COMPARISON SLOTS</span>+ <button onClick={addSlot} style={{ padding: '2px 6px', backgroundColor: '#1a1a1a', color: '#10b981', border: '1px solid #404040', cursor: 'pointer', fontSize: '9px' }}>+ <Plus size={10} />+ </button>+ </div>++ <div style={{ maxHeight: '300px', overflowY: 'auto' }}>+ {slots.map((slot, idx) => (+ <div key={idx} style={{ marginBottom: '6px', padding: '6px', backgroundColor: '#1a1a1a', border: '1px solid #404040', borderRadius: '2px' }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '4px' }}>+ <span style={{ color: '#fbbf24', fontSize: '9px' }}>SLOT {idx + 1} ({slot.length})</span>+ <div style={{ display: 'flex', gap: '2px' }}>+ <button onClick={() => addToSlot(idx)} disabled={!currentData} style={{ padding: '2px 4px', backgroundColor: '#0a0a0a', color: '#10b981', border: '1px solid #404040', cursor: !currentData ? 'not-allowed' : 'pointer', fontSize: '8px' }}>+ <Plus size={8} />+ </button>+ {slots.length > 1 && (+ <button onClick={() => removeSlot(idx)} style={{ padding: '2px 4px', backgroundColor: '#0a0a0a', color: '#ef4444', border: '1px solid #404040', cursor: 'pointer', fontSize: '8px' }}>+ <Minus size={8} />+ </button>+ )}+ </div>+ </div>+ {slot.map((s, sIdx) => (+ <div key={sIdx} style={{ fontSize: '8px', color: '#737373', display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '2px' }}>+ <span style={{ flex: 1, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }} title={s.series_name}>{s.series_name}</span>+ <button onClick={() => removeFromSlot(idx, sIdx)} style={{ padding: '1px 3px', backgroundColor: 'transparent', color: '#ef4444', border: 'none', cursor: 'pointer', fontSize: '8px' }}>+ ×+ </button>+ </div>+ ))}+ {slot.length === 0 && <div style={{ fontSize: '8px', color: '#404040', textAlign: 'center' }}>Empty</div>}+ </div>+ ))}+ </div>+ </div>+ </div>++ {/* Right Panel */}+ <div style={{ flex: 1, display: 'flex', flexDirection: 'column', overflow: 'hidden' }}>+ {/* View Toggle */}+ <div style={{ padding: '8px 12px', borderBottom: '1px solid #404040', display: 'flex', gap: '8px', alignItems: 'center' }}>+ <button onClick={() => setActiveView('single')} style={{ padding: '4px 12px', backgroundColor: activeView === 'single' ? '#ea580c' : '#2d2d2d', color: '#fff', border: '1px solid #404040', cursor: 'pointer', fontSize: '10px' }}>+ SINGLE+ </button>+ <button onClick={() => setActiveView('comparison')} style={{ padding: '4px 12px', backgroundColor: activeView === 'comparison' ? '#ea580c' : '#2d2d2d', color: '#fff', border: '1px solid #404040', cursor: 'pointer', fontSize: '10px' }}>+ COMPARE+ </button>++ {activeView === 'single' ? (+ <>+ <div style={{ color: '#737373', fontSize: '9px', marginLeft: '8px' }}>Chart Type:</div>+ {(['line', 'bar', 'area', 'scatter', 'candlestick'] as ChartType[]).map(type => (+ <button key={type} onClick={() => setSingleChartType(type)} style={{ padding: '3px 8px', backgroundColor: singleChartType === type ? '#3b82f6' : '#2d2d2d', color: '#fff', border: '1px solid #404040', cursor: 'pointer', fontSize: '9px', textTransform: 'uppercase' }}>+ {type}+ </button>+ ))}+ </>+ ) : null}+ </div>++ {/* Content Area */}+ <div style={{ flex: 1, overflowY: 'auto', padding: '12px' }}>+ {activeView === 'single' ? (+ <div>+ <div style={{ marginBottom: '12px' }}>+ <div style={{ color: '#ea580c', fontSize: '11px', marginBottom: '6px' }}>SINGLE VIEW ({singleViewSeries.length} series)</div>+ {singleViewSeries.map((s, idx) => (+ <div key={idx} style={{ display: 'inline-flex', alignItems: 'center', gap: '4px', padding: '3px 6px', backgroundColor: '#1a1a1a', border: '1px solid #404040', borderRadius: '2px', marginRight: '4px', marginBottom: '4px', fontSize: '9px' }}>+ <div style={{ width: '8px', height: '8px', backgroundColor: s.color, borderRadius: '50%' }}></div>+ <span>{s.series_name.substring(0, 20)}</span>+ <button onClick={() => removeFromSingleView(idx)} style={{ padding: '0 4px', backgroundColor: 'transparent', color: '#ef4444', border: 'none', cursor: 'pointer', fontSize: '10px' }}>×</button>+ </div>+ ))}+ </div>++ {singleViewSeries.length > 0 ? (+ <>+ {renderChart(singleViewSeries, singleChartType)}++ {/* Data Table */}+ <div style={{ marginTop: '24px' }}>+ <div style={{ color: '#ea580c', fontSize: '11px', marginBottom: '8px' }}>DATA TABLE</div>+ <div style={{ overflowX: 'auto', overflowY: 'auto', maxHeight: '300px', border: '1px solid #404040', backgroundColor: '#0a0a0a' }}>+ <table style={{ width: '100%', borderCollapse: 'collapse', fontSize: '10px' }}>+ <thead style={{ position: 'sticky', top: 0, backgroundColor: '#1a1a1a', zIndex: 1 }}>+ <tr style={{ borderBottom: '2px solid #404040' }}>+ <th style={{ padding: '8px 12px', textAlign: 'left', color: '#ea580c', fontWeight: 'bold', whiteSpace: 'nowrap' }}>Period</th>+ {singleViewSeries.map((series, idx) => (+ <th key={idx} style={{ padding: '8px 12px', textAlign: 'right', fontWeight: 'bold', whiteSpace: 'nowrap' }}>+ <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'flex-end', gap: '6px' }}>+ <div style={{ width: '8px', height: '8px', backgroundColor: series.color, borderRadius: '50%' }}></div>+ <span style={{ color: series.color }}>{series.series_name.substring(0, 25)}</span>+ </div>+ </th>+ ))}+ </tr>+ </thead>+ <tbody>+ {(() => {+ // Get all unique periods across all series+ const allPeriods = Array.from(+ new Set(singleViewSeries.flatMap(s => s.observations.map(o => o.period)))+ ).sort((a, b) => new Date(b).getTime() - new Date(a).getTime());++ return allPeriods.slice(0, 50).map((period, idx) => (+ <tr key={idx} style={{ borderBottom: '1px solid #1a1a1a' }}>+ <td style={{ padding: '6px 12px', color: '#d4d4d4', whiteSpace: 'nowrap', fontWeight: 'bold' }}>{period}</td>+ {singleViewSeries.map((series, sIdx) => {+ const obs = series.observations.find(o => o.period === period);+ return (+ <td key={sIdx} style={{ padding: '6px 12px', textAlign: 'right', color: obs ? '#a3a3a3' : '#404040', whiteSpace: 'nowrap' }}>+ {obs ? obs.value.toFixed(4) : '—'}+ </td>+ );+ })}+ </tr>+ ));+ })()}+ </tbody>+ </table>+ </div>+ <div style={{ color: '#737373', fontSize: '9px', marginTop: '6px', textAlign: 'right' }}>+ Showing latest 50 periods+ </div>+ </div>+ </>+ ) : (+ <div style={{ color: '#737373', textAlign: 'center', paddingTop: '40px' }}>Add series to view</div>+ )}+ </div>+ ) : (+ <div>+ <div style={{ color: '#ea580c', marginBottom: '12px', fontSize: '11px' }}>COMPARISON DASHBOARD</div>+ <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(380px, 1fr))', gap: '16px' }}>+ {slots.map((slot, idx) => (+ <div key={idx} style={{ border: '1px solid #404040', padding: '12px', backgroundColor: '#0a0a0a', minHeight: '280px', display: 'flex', flexDirection: 'column' }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '8px' }}>+ <div style={{ color: '#fbbf24', fontSize: '10px' }}>SLOT {idx + 1}</div>+ <select value={slotChartTypes[idx]} onChange={(e) => { const newTypes = [...slotChartTypes]; newTypes[idx] = e.target.value as ChartType; setSlotChartTypes(newTypes); }} style={{ padding: '2px 4px', backgroundColor: '#1a1a1a', color: '#d4d4d4', border: '1px solid #404040', fontSize: '8px', fontFamily: 'Consolas, monospace' }}>+ <option value="line">LINE</option>+ <option value="bar">BAR</option>+ <option value="area">AREA</option>+ <option value="scatter">SCATTER</option>+ <option value="candlestick">CANDLE</option>+ </select>+ </div>+ <div style={{ flex: 1, display: 'flex', alignItems: 'center', justifyContent: 'center', minHeight: '240px' }}>+ {slot.length > 0 ? renderChart(slot, slotChartTypes[idx], true) : <div style={{ color: '#404040', textAlign: 'center', fontSize: '10px' }}>Empty Slot</div>}+ </div>+ </div>+ ))}+ </div>+ </div>+ )}+ </div>+ </div>+ </div>+ </div>+ );+}\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/tabs/DocsTab.tsx b/fincept-terminal-desktop/src/components/tabs/DocsTab.tsxnew file mode 100644index 000000000..29762e99b--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/DocsTab.tsx@@ -0,0 +1,612 @@+import React, { useState } from 'react';+import { Book, Search, ChevronRight, Code, FileText, Zap, TrendingUp, Database, Terminal } from 'lucide-react';++interface DocSection {+ id: string;+ title: string;+ icon: any;+ subsections: {+ id: string;+ title: string;+ content: string;+ codeExample?: string;+ }[];+}++export default function DocsTab() {+ const [selectedSection, setSelectedSection] = useState('getting-started');+ const [searchQuery, setSearchQuery] = useState('');+ const [expandedSections, setExpandedSections] = useState<string[]>(['finscript']);++ const C = {+ ORANGE: '#FF8C00',+ WHITE: '#FFFFFF',+ GREEN: '#00FF00',+ BLUE: '#4169E1',+ CYAN: '#00FFFF',+ YELLOW: '#FFFF00',+ GRAY: '#787878',+ DARK_BG: '#000000',+ PANEL_BG: '#0a0a0a',+ CODE_BG: '#1a1a1a'+ };++ const docs: DocSection[] = [+ {+ id: 'finscript',+ title: 'FinScript Language',+ icon: Code,+ subsections: [+ {+ id: 'getting-started',+ title: 'Getting Started',+ content: `FinScript is a domain-specific language (DSL) designed for financial analysis and algorithmic trading. It provides a simple, intuitive syntax for defining trading strategies, calculating technical indicators, and generating trading signals.++**Key Features:**+• Simple syntax inspired by Pine Script+• Built-in technical indicators (EMA, SMA, WMA, RSI, MACD, etc.)+• Real-time data integration with Yahoo Finance+• Automatic chart generation+• Buy/Sell signal generation+• Backtesting capabilities`,+ codeExample: `// Your first FinScript program+if ema(AAPL, 21) > wma(AAPL, 50) {+ buy "Bullish crossover signal"+}++plot ema(AAPL, 21), "EMA 21"+plot wma(AAPL, 50), "WMA 50"`+ },+ {+ id: 'syntax',+ title: 'Basic Syntax',+ content: `FinScript uses a clean, declarative syntax. Here are the core language constructs:++**Comments:**+Use // for single-line comments++**Variables:**+Variables are automatically typed based on indicator functions++**Conditionals:**+Use if statements to define trading logic++**Functions:**+Built-in functions for technical analysis`,+ codeExample: `// Comments explain your strategy+// Variables are created by indicators+fast_ema = ema(TSLA, 12)+slow_ema = ema(TSLA, 26)++// Conditionals for signals+if fast_ema > slow_ema {+ buy "Fast EMA crossed above Slow EMA"+}++if fast_ema < slow_ema {+ sell "Fast EMA crossed below Slow EMA"+}`+ },+ {+ id: 'indicators',+ title: 'Technical Indicators',+ content: `FinScript provides a comprehensive suite of technical indicators for market analysis:++**Moving Averages:**+• ema(symbol, period) - Exponential Moving Average+• sma(symbol, period) - Simple Moving Average+• wma(symbol, period) - Weighted Moving Average++**Momentum Indicators:**+• rsi(symbol, period) - Relative Strength Index+• macd(symbol, fast, slow, signal) - MACD+• stochastic(symbol, period) - Stochastic Oscillator++**Volatility:**+• atr(symbol, period) - Average True Range+• bollinger(symbol, period, std) - Bollinger Bands++**Volume:**+• volume(symbol) - Trading Volume+• obv(symbol) - On-Balance Volume`,+ codeExample: `// Using multiple indicators+price = close(AAPL)+ema_fast = ema(AAPL, 12)+ema_slow = ema(AAPL, 26)+rsi_value = rsi(AAPL, 14)++// Combine indicators for strategy+if ema_fast > ema_slow and rsi_value < 30 {+ buy "Oversold with bullish trend"+}++plot ema_fast, "EMA 12"+plot ema_slow, "EMA 26"+plot rsi_value, "RSI 14"`+ },+ {+ id: 'plotting',+ title: 'Visualization & Plotting',+ content: `FinScript provides powerful charting capabilities to visualize your strategies:++**plot** - Plot indicator values+Syntax: plot indicator, "label"++**plot_candlestick** - Generate OHLC candlestick charts+Syntax: plot_candlestick symbol, "chart_title"++**plot_line** - Draw custom lines+Syntax: plot_line value, "label", color++Charts are automatically generated and saved as PNG files in your working directory.`,+ codeExample: `// Visualize your strategy+symbol = MSFT++// Plot multiple indicators+plot ema(symbol, 7), "EMA 7"+plot ema(symbol, 21), "EMA 21"+plot sma(symbol, 50), "SMA 50"++// Generate candlestick chart+plot_candlestick symbol, "Microsoft Stock Chart"++// Add support/resistance lines+plot_line 300.0, "Resistance", "red"+plot_line 250.0, "Support", "green"`+ },+ {+ id: 'signals',+ title: 'Trading Signals',+ content: `Generate buy and sell signals based on your trading logic:++**buy** - Generate a buy signal+Syntax: buy "reason for buying"++**sell** - Generate a sell signal+Syntax: sell "reason for selling"++Signals are logged with timestamps and can trigger automated trading when integrated with brokers.++**Best Practices:**+• Always include descriptive messages+• Use multiple confirmation indicators+• Implement risk management+• Test thoroughly with historical data`,+ codeExample: `// Crossover strategy with signals+fast = ema(GOOGL, 12)+slow = ema(GOOGL, 26)+momentum = rsi(GOOGL, 14)++// Buy signal with multiple confirmations+if fast > slow and momentum > 50 {+ buy "EMA crossover with positive momentum"+}++// Sell signal with risk management+if fast < slow or momentum > 70 {+ sell "EMA crossover or overbought condition"+}++// Plot for visual confirmation+plot fast, "Fast EMA"+plot slow, "Slow EMA"`+ }+ ]+ },+ {+ id: 'api',+ title: 'API Reference',+ icon: Database,+ subsections: [+ {+ id: 'data-api',+ title: 'Data API',+ content: `Access real-time and historical market data through our unified API:++**Endpoints:**+• GET /api/v1/quote/{symbol} - Get latest quote+• GET /api/v1/historical/{symbol} - Historical OHLCV data+• GET /api/v1/indicators/{symbol} - Calculated indicators+• POST /api/v1/backtest - Run strategy backtest++**Authentication:**+Use API keys in the X-API-Key header++**Rate Limits:**+• Free tier: 100 requests/hour+• Pro tier: 1000 requests/hour+• Enterprise: Unlimited`,+ codeExample: `// Example API calls+// Get real-time quote+fetch('https://api.fincept.com/v1/quote/AAPL', {+ headers: {+ 'X-API-Key': 'your_api_key_here'+ }+})++// Get historical data+fetch('https://api.fincept.com/v1/historical/AAPL?period=1y', {+ headers: {+ 'X-API-Key': 'your_api_key_here'+ }+})`+ },+ {+ id: 'websocket',+ title: 'WebSocket Streaming',+ content: `Real-time data streaming via WebSocket for live market data:++**Connection:**+wss://stream.fincept.com/v1/quotes++**Subscribe to symbols:**+Send JSON: {"action": "subscribe", "symbols": ["AAPL", "TSLA"]}++**Message Format:**+Receive real-time tick data as JSON++**Features:**+• Sub-millisecond latency+• Level 2 order book data+• Trade execution updates+• Market depth information`,+ codeExample: `// WebSocket connection example+const ws = new WebSocket('wss://stream.fincept.com/v1/quotes');++ws.onopen = () => {+ // Subscribe to symbols+ ws.send(JSON.stringify({+ action: 'subscribe',+ symbols: ['AAPL', 'TSLA', 'GOOGL']+ }));+};++ws.onmessage = (event) => {+ const data = JSON.parse(event.data);+ console.log('Live quote:', data);+};`+ }+ ]+ },+ {+ id: 'terminal',+ title: 'Terminal Features',+ icon: Terminal,+ subsections: [+ {+ id: 'shortcuts',+ title: 'Keyboard Shortcuts',+ content: `Master the terminal with these keyboard shortcuts:++**Global Shortcuts:**+• F1 - Help+• F2 - Markets+• F3 - News+• F4 - Portfolio+• F5 - Analytics+• F11 - Fullscreen toggle+• Ctrl+S - Save current file+• Ctrl+N - New file+• Ctrl+O - Open file++**Editor Shortcuts:**+• Ctrl+/ - Comment/Uncomment+• Ctrl+F - Find+• Ctrl+R - Run code+• Ctrl+Shift+K - Clear output++**Navigation:**+• Ctrl+Tab - Next tab+• Ctrl+Shift+Tab - Previous tab+• Ctrl+W - Close tab`,+ codeExample: `// Quick actions in editor+// Press Ctrl+/ to toggle comments+// if ema(AAPL, 21) > sma(AAPL, 50) {+// buy "EMA crosses SMA"+// }++// Press Ctrl+R to execute code+plot ema(AAPL, 21), "EMA 21"++// Press Ctrl+S to save file`+ },+ {+ id: 'customization',+ title: 'Customization',+ content: `Customize the terminal to match your workflow:++**Themes:**+• Bloomberg Classic (default)+• Dark Mode+• Light Mode+• Custom themes via CSS++**Layouts:**+• Single panel+• Dual panel (editor + output)+• Triple panel (editor + output + charts)+• Customizable panel sizes++**Settings:**+• Font size and family+• Tab size (spaces)+• Auto-save interval+• Data refresh rate+• Chart colors and styles`,+ codeExample: `// Example settings.json+{+ "theme": "bloomberg-classic",+ "editor": {+ "fontSize": 14,+ "fontFamily": "Consolas",+ "tabSize": 4,+ "autoSave": true,+ "autoSaveInterval": 5000+ },+ "terminal": {+ "refreshRate": 1000,+ "enableNotifications": true+ }+}`+ }+ ]+ },+ {+ id: 'tutorials',+ title: 'Tutorials',+ icon: Book,+ subsections: [+ {+ id: 'first-strategy',+ title: 'Build Your First Strategy',+ content: `Let's build a simple moving average crossover strategy from scratch:++**Step 1:** Define your indicators+Calculate fast and slow moving averages++**Step 2:** Create trading logic+Buy when fast MA crosses above slow MA+Sell when fast MA crosses below slow MA++**Step 3:** Add visualization+Plot your indicators on a chart++**Step 4:** Run and test+Execute your strategy and analyze results++This is one of the most popular strategies used by traders worldwide!`,+ codeExample: `// Complete MA Crossover Strategy+symbol = AAPL++// Step 1: Define indicators+fast_ma = ema(symbol, 12)+slow_ma = ema(symbol, 26)++// Step 2: Trading logic+if fast_ma > slow_ma {+ buy "Bullish crossover - Fast MA above Slow MA"+}++if fast_ma < slow_ma {+ sell "Bearish crossover - Fast MA below Slow MA"+}++// Step 3: Visualization+plot fast_ma, "Fast EMA (12)"+plot slow_ma, "Slow EMA (26)"+plot_candlestick symbol, "Apple Stock"++// Done! Press Ctrl+R to run`+ },+ {+ id: 'advanced-strategy',+ title: 'Advanced: Multi-Indicator Strategy',+ content: `Build a sophisticated strategy combining multiple indicators:++**Indicators Used:**+• EMA (12, 26) for trend+• RSI (14) for momentum+• Bollinger Bands for volatility+• Volume for confirmation++**Strategy Rules:**+• Buy: Bullish trend + oversold + high volume+• Sell: Bearish trend + overbought OR stop loss++This demonstrates how to combine multiple signals for robust trading decisions.`,+ codeExample: `// Advanced Multi-Indicator Strategy+symbol = TSLA++// Indicators+ema_fast = ema(symbol, 12)+ema_slow = ema(symbol, 26)+rsi_val = rsi(symbol, 14)+vol = volume(symbol)+avg_vol = sma(vol, 20)++// Buy conditions (all must be true)+trend_bullish = ema_fast > ema_slow+oversold = rsi_val < 30+volume_spike = vol > avg_vol * 1.5++if trend_bullish and oversold and volume_spike {+ buy "Strong buy: Bullish trend + oversold + volume"+}++// Sell conditions (any can trigger)+trend_bearish = ema_fast < ema_slow+overbought = rsi_val > 70++if trend_bearish or overbought {+ sell "Exit: Trend reversal or overbought"+}++// Visualize everything+plot ema_fast, "EMA 12"+plot ema_slow, "EMA 26"+plot rsi_val, "RSI"`+ }+ ]+ }+ ];++ const toggleSection = (sectionId: string) => {+ setExpandedSections(prev =>+ prev.includes(sectionId)+ ? prev.filter(id => id !== sectionId)+ : [...prev, sectionId]+ );+ };++ const filteredDocs = docs.map(section => ({+ ...section,+ subsections: section.subsections.filter(sub =>+ searchQuery === '' ||+ sub.title.toLowerCase().includes(searchQuery.toLowerCase()) ||+ sub.content.toLowerCase().includes(searchQuery.toLowerCase())+ )+ })).filter(section => section.subsections.length > 0);++ const activeSubsection = docs+ .flatMap(s => s.subsections)+ .find(sub => sub.id === selectedSection);++ return (+ <div style={{ width: '100%', height: '100%', backgroundColor: C.DARK_BG, color: C.WHITE, fontFamily: 'Consolas, monospace', display: 'flex', flexDirection: 'column' }}>+ <style>{`+ .docs-scroll::-webkit-scrollbar { width: 8px; }+ .docs-scroll::-webkit-scrollbar-track { background: #1a1a1a; }+ .docs-scroll::-webkit-scrollbar-thumb { background: #404040; border-radius: 4px; }+ .docs-scroll::-webkit-scrollbar-thumb:hover { background: #525252; }++ .docs-content h1 { color: ${C.ORANGE}; font-size: 24px; margin: 24px 0 16px 0; }+ .docs-content h2 { color: ${C.CYAN}; font-size: 18px; margin: 20px 0 12px 0; }+ .docs-content p { line-height: 1.8; margin: 12px 0; }+ .docs-content ul { margin: 12px 0; padding-left: 24px; }+ .docs-content li { margin: 6px 0; line-height: 1.6; }+ `}</style>++ {/* Header */}+ <div style={{ backgroundColor: C.PANEL_BG, borderBottom: `2px solid ${C.GRAY}`, padding: '8px 16px' }}>+ <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>+ <Book size={20} style={{ color: C.ORANGE }} />+ <span style={{ color: C.ORANGE, fontWeight: 'bold', fontSize: '16px' }}>DOCUMENTATION</span>+ <span style={{ color: C.GRAY }}>|</span>+ <span style={{ color: C.CYAN, fontSize: '12px' }}>Complete Guide & API Reference</span>+ </div>+ </div>+ </div>++ {/* Search Bar */}+ <div style={{ backgroundColor: C.PANEL_BG, borderBottom: `1px solid ${C.GRAY}`, padding: '12px 16px' }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px', backgroundColor: C.DARK_BG, border: `1px solid ${C.GRAY}`, padding: '8px 12px' }}>+ <Search size={16} style={{ color: C.GRAY }} />+ <input+ type="text"+ placeholder="Search documentation..."+ value={searchQuery}+ onChange={(e) => setSearchQuery(e.target.value)}+ style={{ flex: 1, backgroundColor: 'transparent', border: 'none', outline: 'none', color: C.WHITE, fontSize: '13px', fontFamily: 'Consolas, monospace' }}+ />+ </div>+ </div>++ {/* Main Content */}+ <div style={{ flex: 1, display: 'flex', minHeight: 0 }}>+ {/* Sidebar Navigation */}+ <div className="docs-scroll" style={{ width: '280px', borderRight: `1px solid ${C.GRAY}`, backgroundColor: C.PANEL_BG, overflowY: 'auto', padding: '12px' }}>+ {filteredDocs.map(section => (+ <div key={section.id} style={{ marginBottom: '8px' }}>+ <div+ onClick={() => toggleSection(section.id)}+ style={{ display: 'flex', alignItems: 'center', gap: '8px', padding: '8px', backgroundColor: C.DARK_BG, cursor: 'pointer', border: `1px solid ${C.GRAY}` }}+ >+ <section.icon size={14} style={{ color: C.ORANGE }} />+ <span style={{ flex: 1, fontSize: '12px', fontWeight: 'bold', color: C.WHITE }}>{section.title}</span>+ <ChevronRight+ size={14}+ style={{ color: C.GRAY, transform: expandedSections.includes(section.id) ? 'rotate(90deg)' : 'rotate(0deg)', transition: 'transform 0.2s' }}+ />+ </div>+ {expandedSections.includes(section.id) && (+ <div style={{ marginTop: '4px', marginLeft: '12px' }}>+ {section.subsections.map(sub => (+ <div+ key={sub.id}+ onClick={() => setSelectedSection(sub.id)}+ style={{ padding: '8px 12px', fontSize: '11px', color: selectedSection === sub.id ? C.ORANGE : C.GRAY, backgroundColor: selectedSection === sub.id ? C.DARK_BG : 'transparent', cursor: 'pointer', borderLeft: `2px solid ${selectedSection === sub.id ? C.ORANGE : 'transparent'}` }}+ >+ {sub.title}+ </div>+ ))}+ </div>+ )}+ </div>+ ))}+ </div>++ {/* Content Area */}+ <div className="docs-scroll" style={{ flex: 1, overflowY: 'auto', padding: '24px', backgroundColor: '#050505' }}>+ <div style={{ maxWidth: '900px', margin: '0 auto' }}>+ {activeSubsection ? (+ <>+ <h1 style={{ color: C.ORANGE, fontSize: '28px', marginBottom: '16px', borderBottom: `2px solid ${C.ORANGE}`, paddingBottom: '12px' }}>+ {activeSubsection.title}+ </h1>+ <div className="docs-content" style={{ fontSize: '14px', lineHeight: '1.8', color: C.WHITE }}>+ {activeSubsection.content.split('\n\n').map((para, idx) => (+ <p key={idx} style={{ marginBottom: '16px', whiteSpace: 'pre-wrap' }}>+ {para.split('\n').map((line, lineIdx) => {+ if (line.startsWith('**') && line.endsWith('**')) {+ return <div key={lineIdx} style={{ color: C.CYAN, fontWeight: 'bold', marginTop: '16px', marginBottom: '8px' }}>{line.replace(/\*\*/g, '')}</div>;+ }+ if (line.startsWith('•')) {+ return <li key={lineIdx} style={{ marginLeft: '20px', marginBottom: '4px' }}>{line.substring(1).trim()}</li>;+ }+ return <span key={lineIdx}>{line}<br /></span>;+ })}+ </p>+ ))}+ </div>++ {activeSubsection.codeExample && (+ <div style={{ marginTop: '24px' }}>+ <div style={{ color: C.ORANGE, fontSize: '14px', fontWeight: 'bold', marginBottom: '8px', display: 'flex', alignItems: 'center', gap: '8px' }}>+ <Code size={16} />+ CODE EXAMPLE+ </div>+ <pre style={{ backgroundColor: C.CODE_BG, border: `1px solid ${C.GRAY}`, padding: '16px', borderRadius: '4px', overflowX: 'auto', fontSize: '13px', lineHeight: '1.6', color: C.GREEN }}>+ <code>{activeSubsection.codeExample}</code>+ </pre>+ </div>+ )}+ </>+ ) : (+ <div style={{ textAlign: 'center', paddingTop: '60px', color: C.GRAY }}>+ <Book size={48} style={{ marginBottom: '16px', opacity: 0.5 }} />+ <div style={{ fontSize: '16px' }}>Select a topic from the sidebar</div>+ </div>+ )}+ </div>+ </div>+ </div>++ {/* Footer */}+ <div style={{ borderTop: `2px solid ${C.ORANGE}`, backgroundColor: C.PANEL_BG, padding: '8px 16px', fontSize: '11px' }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '16px' }}>+ <span style={{ color: C.ORANGE, fontWeight: 'bold' }}>FINCEPT DOCS v3.0</span>+ <span style={{ color: C.GRAY }}>|</span>+ <span style={{ color: C.CYAN }}>FinScript Language Reference</span>+ <span style={{ color: C.GRAY }}>|</span>+ <span style={{ color: C.BLUE }}>API Documentation</span>+ </div>+ <div style={{ color: C.GRAY }}>+ {activeSubsection ? activeSubsection.title : 'Browse Documentation'}+ </div>+ </div>+ </div>+ </div>+ );+}\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/tabs/EconomicCalendarTab.tsx b/fincept-terminal-desktop/src/components/tabs/EconomicCalendarTab.tsxnew file mode 100644index 000000000..a6cef282e--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/EconomicCalendarTab.tsx@@ -0,0 +1,578 @@+import React, { useState, useEffect } from 'react';++interface EconomicEvent {+ time: string;+ country: string;+ flag: string;+ indicator: string;+ importance: 'HIGH' | 'MEDIUM' | 'LOW';+ actual: string;+ forecast: string;+ previous: string;+ impact: 'POSITIVE' | 'NEGATIVE' | 'NEUTRAL';+ category: string;+}++const EconomicCalendarTab: React.FC = () => {+ const [currentTime, setCurrentTime] = useState(new Date());+ const [selectedDate, setSelectedDate] = useState('2025-03-15');+ const [selectedImportance, setSelectedImportance] = useState('ALL');+ const [selectedCountry, setSelectedCountry] = useState('ALL');++ const COLOR_ORANGE = '#FFA500';+ const COLOR_WHITE = '#FFFFFF';+ const COLOR_RED = '#FF0000';+ const COLOR_GREEN = '#00C800';+ const COLOR_YELLOW = '#FFFF00';+ const COLOR_GRAY = '#787878';+ const COLOR_BLUE = '#6496FA';+ const COLOR_PURPLE = '#C864FF';+ const COLOR_CYAN = '#00FFFF';+ const COLOR_DARK_BG = '#000000';+ const COLOR_PANEL_BG = '#0a0a0a';++ useEffect(() => {+ const timer = setInterval(() => setCurrentTime(new Date()), 1000);+ return () => clearInterval(timer);+ }, []);++ const economicEvents: EconomicEvent[] = [+ {+ time: '08:30',+ country: 'US',+ flag: '🇺🇸',+ indicator: 'Non-Farm Payrolls',+ importance: 'HIGH',+ actual: '275K',+ forecast: '198K',+ previous: '229K',+ impact: 'POSITIVE',+ category: 'Employment'+ },+ {+ time: '08:30',+ country: 'US',+ flag: '🇺🇸',+ indicator: 'Unemployment Rate',+ importance: 'HIGH',+ actual: '3.6%',+ forecast: '3.7%',+ previous: '3.7%',+ impact: 'POSITIVE',+ category: 'Employment'+ },+ {+ time: '08:30',+ country: 'US',+ flag: '🇺🇸',+ indicator: 'Average Hourly Earnings (MoM)',+ importance: 'MEDIUM',+ actual: '0.4%',+ forecast: '0.3%',+ previous: '0.6%',+ impact: 'POSITIVE',+ category: 'Employment'+ },+ {+ time: '10:00',+ country: 'US',+ flag: '🇺🇸',+ indicator: 'ISM Services PMI',+ importance: 'HIGH',+ actual: '53.4',+ forecast: '52.0',+ previous: '50.6',+ impact: 'POSITIVE',+ category: 'Economic Activity'+ },+ {+ time: '14:00',+ country: 'US',+ flag: '🇺🇸',+ indicator: 'FOMC Member Speech',+ importance: 'MEDIUM',+ actual: '-',+ forecast: '-',+ previous: '-',+ impact: 'NEUTRAL',+ category: 'Central Bank'+ },+ {+ time: '03:00',+ country: 'CN',+ flag: '🇨🇳',+ indicator: 'CPI (YoY)',+ importance: 'HIGH',+ actual: '0.8%',+ forecast: '0.5%',+ previous: '0.3%',+ impact: 'POSITIVE',+ category: 'Inflation'+ },+ {+ time: '03:30',+ country: 'CN',+ flag: '🇨🇳',+ indicator: 'PPI (YoY)',+ importance: 'MEDIUM',+ actual: '-2.5%',+ forecast: '-2.6%',+ previous: '-2.7%',+ impact: 'POSITIVE',+ category: 'Inflation'+ },+ {+ time: '05:00',+ country: 'EU',+ flag: '🇪🇺',+ indicator: 'ECB Interest Rate Decision',+ importance: 'HIGH',+ actual: '4.50%',+ forecast: '4.50%',+ previous: '4.50%',+ impact: 'NEUTRAL',+ category: 'Central Bank'+ },+ {+ time: '05:30',+ country: 'EU',+ flag: '🇪🇺',+ indicator: 'ECB Press Conference',+ importance: 'HIGH',+ actual: '-',+ forecast: '-',+ previous: '-',+ impact: 'NEUTRAL',+ category: 'Central Bank'+ },+ {+ time: '06:00',+ country: 'GB',+ flag: '🇬🇧',+ indicator: 'GDP (QoQ)',+ importance: 'HIGH',+ actual: '0.2%',+ forecast: '0.1%',+ previous: '0.0%',+ impact: 'POSITIVE',+ category: 'Economic Activity'+ },+ {+ time: '23:50',+ country: 'JP',+ flag: '🇯🇵',+ indicator: 'BoJ Monetary Policy Statement',+ importance: 'HIGH',+ actual: '-',+ forecast: '-',+ previous: '-',+ impact: 'NEUTRAL',+ category: 'Central Bank'+ },+ {+ time: '07:00',+ country: 'DE',+ flag: '🇩🇪',+ indicator: 'Industrial Production (MoM)',+ importance: 'MEDIUM',+ actual: '1.2%',+ forecast: '0.8%',+ previous: '-1.1%',+ impact: 'POSITIVE',+ category: 'Economic Activity'+ }+ ];++ const upcomingCentralBankMeetings = [+ { date: '2025-03-20', bank: 'FOMC', decision: 'Rate Decision', expected: '5.25-5.50%' },+ { date: '2025-04-10', bank: 'ECB', decision: 'Rate Decision', expected: '4.50%' },+ { date: '2025-04-25', bank: 'BoJ', decision: 'Policy Meeting', expected: 'No Change' },+ { date: '2025-05-01', bank: 'FOMC', decision: 'Rate Decision', expected: '5.00-5.25%' }+ ];++ const economicIndicators = [+ { name: 'GDP Growth (US)', value: '2.4%', change: 0.1, trend: 'up' },+ { name: 'Unemployment (US)', value: '3.6%', change: -0.1, trend: 'down' },+ { name: 'CPI Inflation (US)', value: '3.2%', change: 0.2, trend: 'up' },+ { name: 'Fed Funds Rate', value: '5.50%', change: 0.0, trend: 'stable' },+ { name: 'GDP Growth (EU)', value: '0.5%', change: 0.2, trend: 'up' },+ { name: 'ECB Rate', value: '4.50%', change: 0.0, trend: 'stable' }+ ];++ const filteredEvents = economicEvents.filter(e =>+ (selectedImportance === 'ALL' || e.importance === selectedImportance) &&+ (selectedCountry === 'ALL' || e.country === selectedCountry)+ ).sort((a, b) => a.time.localeCompare(b.time));++ const getImportanceColor = (importance: string) => {+ switch(importance) {+ case 'HIGH': return COLOR_RED;+ case 'MEDIUM': return COLOR_ORANGE;+ case 'LOW': return COLOR_YELLOW;+ default: return COLOR_GRAY;+ }+ };++ const getImpactColor = (impact: string) => {+ switch(impact) {+ case 'POSITIVE': return COLOR_GREEN;+ case 'NEGATIVE': return COLOR_RED;+ case 'NEUTRAL': return COLOR_GRAY;+ default: return COLOR_WHITE;+ }+ };++ return (+ <div style={{+ height: '100%',+ backgroundColor: COLOR_DARK_BG,+ color: COLOR_WHITE,+ fontFamily: 'Consolas, monospace',+ overflow: 'hidden',+ display: 'flex',+ flexDirection: 'column',+ fontSize: '12px'+ }}>+ {/* Header */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ borderBottom: `2px solid ${COLOR_GRAY}`,+ padding: '8px 16px',+ flexShrink: 0+ }}>+ <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>+ <span style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '16px' }}>+ ECONOMIC CALENDAR+ </span>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <span style={{ color: COLOR_CYAN }}>GLOBAL EVENTS • INDICATORS • CENTRAL BANKS</span>+ </div>+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>+ <input+ type="date"+ value={selectedDate}+ onChange={(e) => setSelectedDate(e.target.value)}+ style={{+ backgroundColor: COLOR_DARK_BG,+ color: COLOR_CYAN,+ border: `2px solid ${COLOR_GRAY}`,+ padding: '4px 8px',+ fontSize: '11px',+ fontFamily: 'Consolas, monospace'+ }}+ />+ <span style={{ color: COLOR_GRAY, fontSize: '11px' }}>+ {currentTime.toLocaleTimeString()}+ </span>+ </div>+ </div>+ </div>++ {/* Main Content */}+ <div style={{ flex: 1, overflow: 'auto', display: 'flex', gap: '12px', padding: '12px' }}>+ {/* Left Panel - Indicators & CB Meetings */}+ <div style={{ width: '340px', display: 'flex', flexDirection: 'column', gap: '12px' }}>+ {/* Economic Indicators */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ border: `2px solid ${COLOR_GRAY}`,+ borderLeft: `6px solid ${COLOR_CYAN}`,+ padding: '12px'+ }}>+ <div style={{ color: COLOR_ORANGE, fontSize: '13px', fontWeight: 'bold', marginBottom: '12px' }}>+ KEY INDICATORS+ </div>+ <div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>+ {economicIndicators.map((indicator, index) => (+ <div key={index} style={{+ padding: '10px',+ backgroundColor: 'rgba(255,255,255,0.02)',+ border: `1px solid ${COLOR_GRAY}`+ }}>+ <div style={{ color: COLOR_GRAY, fontSize: '10px', marginBottom: '4px' }}>+ {indicator.name}+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>+ <span style={{ color: COLOR_CYAN, fontSize: '16px', fontWeight: 'bold' }}>+ {indicator.value}+ </span>+ <div style={{ display: 'flex', alignItems: 'center', gap: '4px' }}>+ <span style={{+ color: indicator.trend === 'up' ? COLOR_GREEN : indicator.trend === 'down' ? COLOR_RED : COLOR_GRAY,+ fontSize: '12px'+ }}>+ {indicator.trend === 'up' ? '▲' : indicator.trend === 'down' ? '▼' : '●'}+ </span>+ <span style={{+ color: indicator.change > 0 ? COLOR_GREEN : indicator.change < 0 ? COLOR_RED : COLOR_GRAY,+ fontSize: '11px'+ }}>+ {indicator.change > 0 ? '+' : ''}{indicator.change.toFixed(1)}%+ </span>+ </div>+ </div>+ </div>+ ))}+ </div>+ </div>++ {/* Central Bank Meetings */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ border: `2px solid ${COLOR_GRAY}`,+ borderLeft: `6px solid ${COLOR_PURPLE}`,+ padding: '12px'+ }}>+ <div style={{ color: COLOR_ORANGE, fontSize: '13px', fontWeight: 'bold', marginBottom: '12px' }}>+ UPCOMING CB MEETINGS+ </div>+ <div style={{ display: 'flex', flexDirection: 'column', gap: '10px' }}>+ {upcomingCentralBankMeetings.map((meeting, index) => (+ <div key={index} style={{+ padding: '10px',+ backgroundColor: 'rgba(200,100,255,0.05)',+ border: `1px solid ${COLOR_PURPLE}`+ }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '6px' }}>+ <span style={{ color: COLOR_PURPLE, fontWeight: 'bold', fontSize: '12px' }}>+ {meeting.bank}+ </span>+ <span style={{ color: COLOR_GRAY, fontSize: '10px' }}>+ {meeting.date}+ </span>+ </div>+ <div style={{ color: COLOR_WHITE, fontSize: '11px', marginBottom: '4px' }}>+ {meeting.decision}+ </div>+ <div style={{ color: COLOR_CYAN, fontSize: '10px' }}>+ Expected: {meeting.expected}+ </div>+ </div>+ ))}+ </div>+ </div>++ {/* Impact Summary */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ border: `2px solid ${COLOR_GRAY}`,+ borderLeft: `6px solid ${COLOR_GREEN}`,+ padding: '12px'+ }}>+ <div style={{ color: COLOR_ORANGE, fontSize: '13px', fontWeight: 'bold', marginBottom: '12px' }}>+ TODAY'S IMPACT+ </div>+ <div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>+ <div style={{+ padding: '10px',+ backgroundColor: 'rgba(255,0,0,0.05)',+ border: `1px solid ${COLOR_RED}`+ }}>+ <div style={{ color: COLOR_GRAY, fontSize: '10px', marginBottom: '4px' }}>HIGH IMPACT</div>+ <div style={{ color: COLOR_RED, fontSize: '20px', fontWeight: 'bold' }}>7</div>+ <div style={{ color: COLOR_GRAY, fontSize: '9px' }}>events scheduled</div>+ </div>+ <div style={{+ padding: '10px',+ backgroundColor: 'rgba(255,165,0,0.05)',+ border: `1px solid ${COLOR_ORANGE}`+ }}>+ <div style={{ color: COLOR_GRAY, fontSize: '10px', marginBottom: '4px' }}>MEDIUM IMPACT</div>+ <div style={{ color: COLOR_ORANGE, fontSize: '20px', fontWeight: 'bold' }}>3</div>+ <div style={{ color: COLOR_GRAY, fontSize: '9px' }}>events scheduled</div>+ </div>+ <div style={{+ padding: '10px',+ backgroundColor: 'rgba(255,255,0,0.05)',+ border: `1px solid ${COLOR_YELLOW}`+ }}>+ <div style={{ color: COLOR_GRAY, fontSize: '10px', marginBottom: '4px' }}>LOW IMPACT</div>+ <div style={{ color: COLOR_YELLOW, fontSize: '20px', fontWeight: 'bold' }}>2</div>+ <div style={{ color: COLOR_GRAY, fontSize: '9px' }}>events scheduled</div>+ </div>+ </div>+ </div>+ </div>++ {/* Right Panel - Events Calendar */}+ <div style={{ flex: 1, display: 'flex', flexDirection: 'column' }}>+ {/* Filters */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ border: `2px solid ${COLOR_GRAY}`,+ padding: '12px',+ marginBottom: '12px'+ }}>+ <div style={{ display: 'flex', gap: '12px', alignItems: 'center' }}>+ <span style={{ color: COLOR_GRAY, fontSize: '11px' }}>IMPORTANCE:</span>+ {['ALL', 'HIGH', 'MEDIUM', 'LOW'].map((importance) => (+ <button key={importance}+ onClick={() => setSelectedImportance(importance)}+ style={{+ padding: '6px 12px',+ backgroundColor: selectedImportance === importance ? getImportanceColor(importance) : COLOR_DARK_BG,+ border: `2px solid ${selectedImportance === importance ? getImportanceColor(importance) : COLOR_GRAY}`,+ color: selectedImportance === importance ? COLOR_DARK_BG : COLOR_WHITE,+ fontSize: '10px',+ fontWeight: 'bold',+ cursor: 'pointer',+ fontFamily: 'Consolas, monospace'+ }}>+ {importance}+ </button>+ ))}+ <span style={{ color: COLOR_GRAY, marginLeft: '16px' }}>|</span>+ <span style={{ color: COLOR_GRAY, fontSize: '11px' }}>COUNTRY:</span>+ {['ALL', 'US', 'EU', 'GB', 'JP', 'CN'].map((country) => (+ <button key={country}+ onClick={() => setSelectedCountry(country)}+ style={{+ padding: '6px 12px',+ backgroundColor: selectedCountry === country ? COLOR_CYAN : COLOR_DARK_BG,+ border: `2px solid ${selectedCountry === country ? COLOR_CYAN : COLOR_GRAY}`,+ color: selectedCountry === country ? COLOR_DARK_BG : COLOR_WHITE,+ fontSize: '10px',+ fontWeight: 'bold',+ cursor: 'pointer',+ fontFamily: 'Consolas, monospace'+ }}>+ {country}+ </button>+ ))}+ </div>+ </div>++ {/* Events Table */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ border: `2px solid ${COLOR_GRAY}`,+ flex: 1,+ overflow: 'auto'+ }}>+ {/* Table Header */}+ <div style={{+ display: 'grid',+ gridTemplateColumns: '70px 60px 280px 80px 100px 100px 100px 80px',+ padding: '10px 12px',+ backgroundColor: 'rgba(255,165,0,0.1)',+ borderBottom: `2px solid ${COLOR_ORANGE}`,+ position: 'sticky',+ top: 0,+ zIndex: 10+ }}>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '10px' }}>TIME</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '10px' }}>CTRY</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '10px' }}>INDICATOR</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '10px' }}>IMPACT</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '10px' }}>ACTUAL</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '10px' }}>FORECAST</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '10px' }}>PREVIOUS</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '10px' }}>RESULT</div>+ </div>++ {/* Table Body */}+ {filteredEvents.map((event, index) => (+ <div key={index}+ style={{+ display: 'grid',+ gridTemplateColumns: '70px 60px 280px 80px 100px 100px 100px 80px',+ padding: '12px',+ backgroundColor: index % 2 === 0 ? 'rgba(255,255,255,0.02)' : 'transparent',+ borderBottom: `1px solid ${COLOR_GRAY}`,+ cursor: 'pointer',+ fontSize: '11px'+ }}+ onMouseEnter={(e) => {+ e.currentTarget.style.backgroundColor = 'rgba(255,165,0,0.1)';+ }}+ onMouseLeave={(e) => {+ e.currentTarget.style.backgroundColor = index % 2 === 0 ? 'rgba(255,255,255,0.02)' : 'transparent';+ }}>+ <div style={{ color: COLOR_CYAN, fontWeight: 'bold' }}>{event.time}</div>+ <div style={{ fontSize: '16px' }}>{event.flag}</div>+ <div>+ <div style={{ color: COLOR_WHITE, fontWeight: 'bold', marginBottom: '2px' }}>+ {event.indicator}+ </div>+ <div style={{ color: COLOR_GRAY, fontSize: '9px' }}>+ {event.category}+ </div>+ </div>+ <div>+ <span style={{+ padding: '4px 8px',+ backgroundColor: `rgba(${event.importance === 'HIGH' ? '255,0,0' : event.importance === 'MEDIUM' ? '255,165,0' : '255,255,0'},0.2)`,+ border: `1px solid ${getImportanceColor(event.importance)}`,+ color: getImportanceColor(event.importance),+ fontSize: '9px',+ fontWeight: 'bold'+ }}>+ {event.importance}+ </span>+ </div>+ <div style={{ color: COLOR_WHITE, fontWeight: 'bold' }}>{event.actual}</div>+ <div style={{ color: COLOR_YELLOW }}>{event.forecast}</div>+ <div style={{ color: COLOR_GRAY }}>{event.previous}</div>+ <div>+ <span style={{+ color: getImpactColor(event.impact),+ fontSize: '16px'+ }}>+ {event.impact === 'POSITIVE' ? '▲' : event.impact === 'NEGATIVE' ? '▼' : '●'}+ </span>+ </div>+ </div>+ ))}+ </div>+ </div>+ </div>++ {/* Footer */}+ <div style={{+ borderTop: `3px solid ${COLOR_ORANGE}`,+ backgroundColor: COLOR_PANEL_BG,+ padding: '12px 16px',+ fontSize: '11px',+ color: COLOR_WHITE,+ flexShrink: 0+ }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '8px' }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '16px' }}>+ <span style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '13px' }}>+ ECONOMIC CALENDAR v1.0+ </span>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <span style={{ color: COLOR_CYAN }}>+ Real-time economic events & data+ </span>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <span style={{ color: COLOR_GREEN }}>+ Showing: {filteredEvents.length} events+ </span>+ </div>+ </div>+ <div style={{+ display: 'flex',+ justifyContent: 'space-between',+ fontSize: '10px',+ paddingTop: '8px',+ borderTop: `1px solid ${COLOR_GRAY}`+ }}>+ <div style={{ display: 'flex', gap: '16px' }}>+ <span style={{ color: COLOR_GRAY }}><span style={{ color: COLOR_BLUE }}>F1</span> Help</span>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <span style={{ color: COLOR_GRAY }}><span style={{ color: COLOR_BLUE }}>F2</span> Export</span>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <span style={{ color: COLOR_GRAY }}><span style={{ color: COLOR_BLUE }}>F3</span> Alerts</span>+ </div>+ <div style={{ color: COLOR_GRAY }}>+ © 2025 Fincept Labs • All Rights Reserved+ </div>+ </div>+ </div>+ </div>+ );+};++export default EconomicCalendarTab;\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/tabs/EquityResearchTab.tsx b/fincept-terminal-desktop/src/components/tabs/EquityResearchTab.tsxnew file mode 100644index 000000000..7d54bcc52--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/EquityResearchTab.tsx@@ -0,0 +1,845 @@+import React, { useState, useEffect } from 'react';++interface StockAnalysis {+ ticker: string;+ company: string;+ sector: string;+ price: number;+ target: number;+ rating: 'STRONG_BUY' | 'BUY' | 'HOLD' | 'SELL' | 'STRONG_SELL';+ analyst: string;+ firm: string;+ updated: string;+ keyPoints: string[];+ financials: {+ pe: number;+ eps: number;+ revenue: string;+ margin: number;+ debt: string;+ };+ catalysts: string[];+ risks: string[];+}++interface Valuation {+ method: string;+ value: number;+ weight: number;+}++const EquityResearchTab: React.FC = () => {+ const [currentTime, setCurrentTime] = useState(new Date());+ const [selectedStock, setSelectedStock] = useState('AAPL');+ const [activeView, setActiveView] = useState('OVERVIEW');+ const [researchCount] = useState(8947);++ // Bloomberg color scheme+ const BLOOMBERG_ORANGE = '#FFA500';+ const BLOOMBERG_WHITE = '#FFFFFF';+ const BLOOMBERG_RED = '#FF0000';+ const BLOOMBERG_GREEN = '#00C800';+ const BLOOMBERG_YELLOW = '#FFFF00';+ const BLOOMBERG_GRAY = '#787878';+ const BLOOMBERG_BLUE = '#6496FA';+ const BLOOMBERG_PURPLE = '#C864FF';+ const BLOOMBERG_CYAN = '#00FFFF';+ const BLOOMBERG_DARK_BG = '#000000';+ const BLOOMBERG_PANEL_BG = '#0a0a0a';++ useEffect(() => {+ const timer = setInterval(() => {+ setCurrentTime(new Date());+ }, 1000);+ return () => clearInterval(timer);+ }, []);++ const researchReports: StockAnalysis[] = [+ {+ ticker: 'AAPL',+ company: 'Apple Inc.',+ sector: 'Technology',+ price: 184.92,+ target: 225.00,+ rating: 'STRONG_BUY',+ analyst: 'John Smith',+ firm: 'Goldman Sachs',+ updated: '2024-01-15',+ keyPoints: [+ 'iPhone 15 cycle showing stronger-than-expected demand with Pro models mix at 65%',+ 'Services revenue trajectory accelerating - $22.3B quarterly (30% margin) growing 18% YoY',+ 'Vision Pro spatial computing launch represents $50B+ TAM over 5 years',+ 'Apple Silicon transition complete - Mac margins expanded 400bps to 38%',+ 'India manufacturing ramp reducing China dependency - now 12% of iPhone production',+ '$90B annual buyback supporting EPS growth - reduced share count by 3.5% in FY2023'+ ],+ financials: {+ pe: 29.8,+ eps: 6.42,+ revenue: '$383.9B',+ margin: 26.4,+ debt: '$109.3B'+ },+ catalysts: [+ 'Q1 2024 earnings beat expected (Jan 25) - iPhone revenue $69B vs $65B est',+ 'Vision Pro launch Feb 2024 - pre-orders exceeding supply',+ 'AI features integration across ecosystem announced at WWDC June 2024',+ 'Services attach rate improvement - ARPU up 15% YoY to $24/month',+ 'Potential dividend increase (15%+) and buyback expansion to $100B'+ ],+ risks: [+ 'China revenue exposure (18%) - geopolitical tensions and Huawei competition',+ 'Regulatory scrutiny on App Store fees (EU Digital Markets Act)',+ 'iPhone upgrade cycles lengthening - 4.2 years vs 3.5 years historically',+ 'Valuation premium vs peers - trading at 29x vs MSFT 35x, GOOGL 25x'+ ]+ },+ {+ ticker: 'NVDA',+ company: 'NVIDIA Corporation',+ sector: 'Semiconductors',+ price: 501.23,+ target: 750.00,+ rating: 'STRONG_BUY',+ analyst: 'Sarah Chen',+ firm: 'Morgan Stanley',+ updated: '2024-01-14',+ keyPoints: [+ 'Data center GPU revenue $18.4B in Q3 (up 279% YoY) - H100 demand exceeding supply by 3x',+ 'AI infrastructure buildout driving 5-year supercycle - TAM expanding to $1T by 2030',+ 'Gross margins sustained at 75%+ despite competitive pressure from AMD/Intel',+ 'CUDA software moat strengthens - 4M developers, 40K companies using platform',+ 'Automotive/robotics revenue inflecting - $300M quarterly growing 50% YoY',+ 'Next-gen Blackwell architecture (2024) promises 4x performance at same power'+ ],+ financials: {+ pe: 67.2,+ eps: 7.89,+ revenue: '$60.9B',+ margin: 54.8,+ debt: '$9.7B'+ },+ catalysts: [+ 'Q4 earnings (Feb 21) - guidance raise expected to $22B revenue (vs $20B est)',+ 'GTC conference March 2024 - Blackwell GPU unveiling, major cloud partnerships',+ 'Hyperscaler capex acceleration - MSFT/GOOGL/AMZN combined $200B for AI infrastructure',+ 'China export restriction easing potential - could add $5B+ annual revenue',+ 'Automotive design wins - Mercedes, Tesla, BYD partnerships ramping'+ ],+ risks: [+ 'Competitive threats from custom chips (Google TPU, Amazon Trainium, Tesla Dojo)',+ 'Export controls to China limiting 20-25% of datacenter TAM',+ 'Hyperscaler in-house chip development reducing NVDA dependency',+ 'Valuation stretched - trading at 25x forward sales vs 10-year avg of 15x'+ ]+ },+ {+ ticker: 'MSFT',+ company: 'Microsoft Corporation',+ sector: 'Technology',+ price: 378.45,+ target: 450.00,+ rating: 'BUY',+ analyst: 'David Park',+ firm: 'JP Morgan',+ updated: '2024-01-16',+ keyPoints: [+ 'Azure cloud revenue $31.8B quarterly (+29% YoY) - gaining share vs AWS',+ 'OpenAI partnership driving Azure AI services to $1B+ quarterly run rate',+ 'Office 365 Copilot rollout - early adopters showing 30% productivity gains',+ 'Gaming segment stable post-Activision merger - $7.1B quarterly revenue',+ 'Operating leverage improving - op margins expanded to 47% (up 200bps YoY)',+ 'LinkedIn revenue acceleration - $4B quarterly growing 8% (improving from 5%)'+ ],+ financials: {+ pe: 35.2,+ eps: 11.23,+ revenue: '$227.6B',+ margin: 42.1,+ debt: '$97.8B'+ },+ catalysts: [+ 'Copilot monetization inflection - targeting 40% of Office 365 users by Q2',+ 'Azure OpenAI Service expanding - 18K organizations, up from 2.5K in Q1',+ 'Gaming growth reacceleration - Call of Duty integration boosting Game Pass',+ 'Windows 11 AI PC refresh cycle starting - Copilot+ PCs launching Q2 2024'+ ],+ risks: [+ 'OpenAI investment creating dependency - $10B committed, exclusivity concerns',+ 'Azure growth deceleration risk if AI workloads don\'t sustain',+ 'Gaming integration challenges - Activision culture/talent retention',+ 'Regulatory scrutiny on AI partnerships and gaming consolidation'+ ]+ },+ {+ ticker: 'TSLA',+ company: 'Tesla Inc.',+ sector: 'Automotive',+ price: 251.78,+ target: 320.00,+ rating: 'BUY',+ analyst: 'Michael Zhang',+ firm: 'BofA Securities',+ updated: '2024-01-13',+ keyPoints: [+ 'Q4 deliveries beat at 484K units (up 20% YoY) - Model Y best-selling vehicle globally',+ 'Cybertruck production ramping - targeting 200K units in 2024 at 25% gross margin',+ 'Energy storage business inflecting - 15 GWh deployed in 2023 (up 125% YoY)',+ 'FSD Beta v12 neural net showing step-function improvement - intervention rate down 80%',+ 'Cost reduction initiatives - $4,000 per vehicle saved through manufacturing improvements',+ 'Gigafactory Mexico groundbreaking - next-gen $25K vehicle production start 2025'+ ],+ financials: {+ pe: 68.4,+ eps: 3.68,+ revenue: '$96.8B',+ margin: 17.6,+ debt: '$9.4B'+ },+ catalysts: [+ 'Q4 earnings (Jan 24) - guidance for 2M+ deliveries in 2024',+ 'Model 2 ($25K vehicle) reveal expected Q2 2024 - addresses mass market',+ 'FSD subscription take rate improving - now 15% of fleet (vs 11% in Q1)',+ 'Energy storage margins expanding - approaching automotive parity at 20%+',+ 'Robotaxi service beta launch potential in select cities by Q4 2024'+ ],+ risks: [+ 'EV demand uncertainty amid broader auto slowdown and rate environment',+ 'Price cuts impacting margins - 5 reductions in 2023, gross margin compressed to 17.6%',+ 'Competition intensifying - BYD, Hyundai/Kia, legacy OEMs launching competitive EVs',+ 'Regulatory/legal overhang - FSD classification, Autopilot investigations',+ 'Execution risk on multiple initiatives - Cybertruck, Model 2, Robotaxi, Optimus'+ ]+ }+ ];++ const currentStock = researchReports.find(r => r.ticker === selectedStock) || researchReports[0];++ const valuationModels: Valuation[] = [+ { method: 'DCF (10Y)', value: 225.00, weight: 40 },+ { method: 'P/E Multiple', value: 215.00, weight: 25 },+ { method: 'EV/EBITDA', value: 220.00, weight: 20 },+ { method: 'Sum-of-Parts', value: 230.00, weight: 15 }+ ];++ const getRatingColor = (rating: string) => {+ switch (rating) {+ case 'STRONG_BUY': return BLOOMBERG_GREEN;+ case 'BUY': return BLOOMBERG_CYAN;+ case 'HOLD': return BLOOMBERG_YELLOW;+ case 'SELL': return BLOOMBERG_ORANGE;+ case 'STRONG_SELL': return BLOOMBERG_RED;+ default: return BLOOMBERG_GRAY;+ }+ };++ const peerComparison = [+ { ticker: 'AAPL', pe: 29.8, fwdPE: 27.3, pegRatio: 2.1, roe: 147.3, debtEquity: 1.78 },+ { ticker: 'MSFT', pe: 35.2, fwdPE: 31.8, pegRatio: 2.4, roe: 42.1, debtEquity: 0.48 },+ { ticker: 'GOOGL', pe: 25.4, fwdPE: 22.1, pegRatio: 1.9, roe: 28.4, debtEquity: 0.11 },+ { ticker: 'META', pe: 28.7, fwdPE: 24.6, pegRatio: 1.7, roe: 32.8, debtEquity: 0.00 }+ ];++ const recentResearch = [+ { ticker: 'AAPL', action: 'UPGRADE', from: 'BUY', to: 'STRONG_BUY', firm: 'Goldman Sachs', time: '2h ago' },+ { ticker: 'NVDA', action: 'TARGET_RAISE', from: '650', to: '750', firm: 'Morgan Stanley', time: '4h ago' },+ { ticker: 'TSLA', action: 'INITIATE', rating: 'BUY', target: '320', firm: 'BofA Securities', time: '6h ago' },+ { ticker: 'GOOGL', action: 'REITERATE', rating: 'BUY', target: '165', firm: 'JP Morgan', time: '8h ago' },+ { ticker: 'MSFT', action: 'TARGET_RAISE', from: '420', to: '450', firm: 'Barclays', time: '12h ago' }+ ];++ return (+ <div style={{+ height: '100%',+ backgroundColor: BLOOMBERG_DARK_BG,+ color: BLOOMBERG_WHITE,+ fontFamily: 'Consolas, monospace',+ overflow: 'hidden',+ display: 'flex',+ flexDirection: 'column',+ fontSize: '12px'+ }}>+ {/* Header */}+ <div style={{+ backgroundColor: BLOOMBERG_PANEL_BG,+ borderBottom: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '4px 8px',+ flexShrink: 0+ }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px', fontSize: '13px', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_ORANGE, fontWeight: 'bold' }}>FINCEPT EQUITY RESEARCH</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_GREEN }}>● LIVE COVERAGE</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_CYAN }}>REPORTS: {researchCount.toLocaleString()}</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_YELLOW }}>ANALYSTS: 3,847</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_WHITE }}>{currentTime.toISOString().replace('T', ' ').substring(0, 19)} UTC</span>+ </div>++ <div style={{ display: 'flex', alignItems: 'center', gap: '8px', fontSize: '11px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>COVERAGE:</span>+ <span style={{ color: BLOOMBERG_GREEN }}>5,234 STOCKS</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_GRAY }}>TODAY:</span>+ <span style={{ color: BLOOMBERG_GREEN }}>123 UPGRADES</span>+ <span style={{ color: BLOOMBERG_RED }}>45 DOWNGRADES</span>+ <span style={{ color: BLOOMBERG_CYAN }}>234 TARGET CHANGES</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_GRAY }}>CONSENSUS:</span>+ <span style={{ color: BLOOMBERG_GREEN }}>BULLISH 67%</span>+ <span style={{ color: BLOOMBERG_YELLOW }}>NEUTRAL 25%</span>+ <span style={{ color: BLOOMBERG_RED }}>BEARISH 8%</span>+ </div>+ </div>++ {/* Function Keys */}+ <div style={{+ backgroundColor: BLOOMBERG_PANEL_BG,+ borderBottom: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '2px 4px',+ flexShrink: 0+ }}>+ <div style={{ display: 'grid', gridTemplateColumns: 'repeat(12, 1fr)', gap: '2px' }}>+ {[+ { key: "F1", label: "OVERVIEW", view: "OVERVIEW" },+ { key: "F2", label: "VALUATION", view: "VALUATION" },+ { key: "F3", label: "FINANCIALS", view: "FINANCIALS" },+ { key: "F4", label: "CATALYSTS", view: "CATALYSTS" },+ { key: "F5", label: "RISKS", view: "RISKS" },+ { key: "F6", label: "PEERS", view: "PEERS" },+ { key: "F7", label: "ESTIMATE", view: "ESTIMATE" },+ { key: "F8", label: "MODEL", view: "MODEL" },+ { key: "F9", label: "SEARCH", view: "SEARCH" },+ { key: "F10", label: "ALERTS", view: "ALERTS" },+ { key: "F11", label: "EXPORT", view: "EXPORT" },+ { key: "F12", label: "SETTINGS", view: "SETTINGS" }+ ].map(item => (+ <button key={item.key}+ onClick={() => item.view && setActiveView(item.view)}+ style={{+ backgroundColor: activeView === item.view ? BLOOMBERG_ORANGE : BLOOMBERG_DARK_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ color: activeView === item.view ? BLOOMBERG_DARK_BG : BLOOMBERG_WHITE,+ padding: '2px 4px',+ fontSize: '9px',+ height: '16px',+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'center',+ fontWeight: activeView === item.view ? 'bold' : 'normal',+ cursor: 'pointer'+ }}>+ <span style={{ color: BLOOMBERG_YELLOW }}>{item.key}:</span>+ <span style={{ marginLeft: '2px' }}>{item.label}</span>+ </button>+ ))}+ </div>+ </div>++ {/* Main Content */}+ <div style={{ flex: 1, overflow: 'auto', padding: '4px', backgroundColor: '#050505' }}>+ <div style={{ display: 'flex', gap: '4px', height: '100%' }}>++ {/* Left Panel - Stock List */}+ <div style={{+ width: '280px',+ backgroundColor: BLOOMBERG_PANEL_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '4px',+ overflow: 'auto'+ }}>+ <div style={{ color: BLOOMBERG_ORANGE, fontSize: '11px', fontWeight: 'bold', marginBottom: '4px' }}>+ RESEARCH COVERAGE+ </div>+ <div style={{ borderBottom: `1px solid ${BLOOMBERG_GRAY}`, marginBottom: '8px' }}></div>++ {researchReports.map((stock, index) => (+ <button key={index}+ onClick={() => setSelectedStock(stock.ticker)}+ style={{+ width: '100%',+ padding: '6px',+ marginBottom: '3px',+ backgroundColor: selectedStock === stock.ticker ? 'rgba(255,165,0,0.1)' : 'rgba(255,255,255,0.02)',+ border: `1px solid ${selectedStock === stock.ticker ? BLOOMBERG_ORANGE : 'transparent'}`,+ textAlign: 'left',+ cursor: 'pointer',+ fontSize: '10px'+ }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_WHITE, fontWeight: 'bold' }}>{stock.ticker}</span>+ <span style={{ color: getRatingColor(stock.rating), fontSize: '8px' }}>{stock.rating.replace('_', ' ')}</span>+ </div>+ <div style={{ color: BLOOMBERG_GRAY, fontSize: '9px', marginBottom: '2px' }}>{stock.company}</div>+ <div style={{ display: 'flex', justifyContent: 'space-between', fontSize: '9px' }}>+ <span style={{ color: BLOOMBERG_CYAN }}>${stock.price.toFixed(2)}</span>+ <span style={{ color: BLOOMBERG_GREEN }}>PT: ${stock.target.toFixed(2)}</span>+ </div>+ <div style={{ fontSize: '8px', color: BLOOMBERG_GRAY, marginTop: '2px' }}>+ Upside: {((stock.target / stock.price - 1) * 100).toFixed(1)}%+ </div>+ </button>+ ))}++ <div style={{ borderTop: `1px solid ${BLOOMBERG_GRAY}`, marginTop: '12px', paddingTop: '8px' }}>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '10px', fontWeight: 'bold', marginBottom: '4px' }}>+ RECENT UPDATES+ </div>+ {recentResearch.map((item, index) => (+ <div key={index} style={{+ padding: '3px',+ marginBottom: '3px',+ backgroundColor: 'rgba(255,255,255,0.02)',+ fontSize: '8px',+ lineHeight: '1.3'+ }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '1px' }}>+ <span style={{ color: BLOOMBERG_CYAN }}>{item.ticker}</span>+ <span style={{ color: BLOOMBERG_YELLOW }}>{item.time}</span>+ </div>+ <div style={{ color: BLOOMBERG_WHITE, marginBottom: '1px' }}>+ {item.action === 'UPGRADE' && `${item.from} → ${item.to}`}+ {item.action === 'TARGET_RAISE' && `Target: $${item.from} → $${item.to}`}+ {item.action === 'INITIATE' && `Initiate: ${item.rating} PT $${item.target}`}+ {item.action === 'REITERATE' && `Reiterate: ${item.rating} PT $${item.target}`}+ </div>+ <div style={{ color: BLOOMBERG_GRAY }}>{item.firm}</div>+ </div>+ ))}+ </div>++ <div style={{ borderTop: `1px solid ${BLOOMBERG_GRAY}`, marginTop: '12px', paddingTop: '8px' }}>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '10px', fontWeight: 'bold', marginBottom: '4px' }}>+ TOP SECTORS+ </div>+ {[+ { sector: 'Technology', rating: 'OVERWEIGHT', coverage: 847 },+ { sector: 'Financials', rating: 'NEUTRAL', coverage: 623 },+ { sector: 'Healthcare', rating: 'OVERWEIGHT', coverage: 512 },+ { sector: 'Energy', rating: 'OVERWEIGHT', coverage: 289 },+ { sector: 'Consumer', rating: 'UNDERWEIGHT', coverage: 734 }+ ].map((item, index) => (+ <div key={index} style={{+ padding: '2px',+ marginBottom: '2px',+ fontSize: '9px',+ display: 'flex',+ justifyContent: 'space-between'+ }}>+ <span style={{ color: BLOOMBERG_WHITE }}>{item.sector}</span>+ <div>+ <span style={{+ color: item.rating === 'OVERWEIGHT' ? BLOOMBERG_GREEN :+ item.rating === 'NEUTRAL' ? BLOOMBERG_YELLOW : BLOOMBERG_RED,+ marginRight: '4px'+ }}>{item.rating}</span>+ <span style={{ color: BLOOMBERG_GRAY }}>({item.coverage})</span>+ </div>+ </div>+ ))}+ </div>+ </div>++ {/* Center Panel - Research Report */}+ <div style={{+ flex: 1,+ backgroundColor: BLOOMBERG_PANEL_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '8px',+ overflow: 'auto'+ }}>+ {/* Stock Header */}+ <div style={{ marginBottom: '12px' }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', marginBottom: '6px' }}>+ <div>+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px', marginBottom: '4px' }}>+ <span style={{ color: BLOOMBERG_ORANGE, fontSize: '18px', fontWeight: 'bold' }}>{currentStock.ticker}</span>+ <span style={{ color: BLOOMBERG_WHITE, fontSize: '14px' }}>{currentStock.company}</span>+ <span style={{ color: BLOOMBERG_BLUE, fontSize: '10px', padding: '2px 6px', backgroundColor: 'rgba(100,150,250,0.2)' }}>+ {currentStock.sector}+ </span>+ </div>+ <div style={{ display: 'flex', gap: '16px', fontSize: '11px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>ANALYST:</span>+ <span style={{ color: BLOOMBERG_CYAN }}>{currentStock.analyst}</span>+ <span style={{ color: BLOOMBERG_GRAY }}>|</span>+ <span style={{ color: BLOOMBERG_GRAY }}>FIRM:</span>+ <span style={{ color: BLOOMBERG_WHITE }}>{currentStock.firm}</span>+ <span style={{ color: BLOOMBERG_GRAY }}>|</span>+ <span style={{ color: BLOOMBERG_GRAY }}>UPDATED:</span>+ <span style={{ color: BLOOMBERG_YELLOW }}>{currentStock.updated}</span>+ </div>+ </div>+ <div style={{ textAlign: 'right' }}>+ <div style={{ fontSize: '22px', fontWeight: 'bold', color: BLOOMBERG_WHITE, marginBottom: '2px' }}>+ ${currentStock.price.toFixed(2)}+ </div>+ <div style={{ fontSize: '10px', color: BLOOMBERG_GRAY, marginBottom: '4px' }}>+ CURRENT PRICE+ </div>+ </div>+ </div>++ <div style={{ display: 'flex', gap: '20px', padding: '8px', backgroundColor: 'rgba(255,255,255,0.02)', borderRadius: '4px' }}>+ <div>+ <div style={{ color: BLOOMBERG_GRAY, fontSize: '9px', marginBottom: '2px' }}>RATING</div>+ <div style={{ color: getRatingColor(currentStock.rating), fontSize: '12px', fontWeight: 'bold' }}>+ {currentStock.rating.replace('_', ' ')}+ </div>+ </div>+ <div>+ <div style={{ color: BLOOMBERG_GRAY, fontSize: '9px', marginBottom: '2px' }}>PRICE TARGET</div>+ <div style={{ color: BLOOMBERG_GREEN, fontSize: '12px', fontWeight: 'bold' }}>+ ${currentStock.target.toFixed(2)}+ </div>+ </div>+ <div>+ <div style={{ color: BLOOMBERG_GRAY, fontSize: '9px', marginBottom: '2px' }}>UPSIDE</div>+ <div style={{ color: BLOOMBERG_GREEN, fontSize: '12px', fontWeight: 'bold' }}>+ {((currentStock.target / currentStock.price - 1) * 100).toFixed(1)}%+ </div>+ </div>+ <div>+ <div style={{ color: BLOOMBERG_GRAY, fontSize: '9px', marginBottom: '2px' }}>P/E RATIO</div>+ <div style={{ color: BLOOMBERG_CYAN, fontSize: '12px', fontWeight: 'bold' }}>+ {currentStock.financials.pe.toFixed(1)}x+ </div>+ </div>+ <div>+ <div style={{ color: BLOOMBERG_GRAY, fontSize: '9px', marginBottom: '2px' }}>EPS (TTM)</div>+ <div style={{ color: BLOOMBERG_CYAN, fontSize: '12px', fontWeight: 'bold' }}>+ ${currentStock.financials.eps.toFixed(2)}+ </div>+ </div>+ <div>+ <div style={{ color: BLOOMBERG_GRAY, fontSize: '9px', marginBottom: '2px' }}>REVENUE</div>+ <div style={{ color: BLOOMBERG_CYAN, fontSize: '12px', fontWeight: 'bold' }}>+ {currentStock.financials.revenue}+ </div>+ </div>+ <div>+ <div style={{ color: BLOOMBERG_GRAY, fontSize: '9px', marginBottom: '2px' }}>NET MARGIN</div>+ <div style={{ color: BLOOMBERG_GREEN, fontSize: '12px', fontWeight: 'bold' }}>+ {currentStock.financials.margin.toFixed(1)}%+ </div>+ </div>+ </div>+ </div>++ <div style={{ borderBottom: `1px solid ${BLOOMBERG_GRAY}`, marginBottom: '8px' }}></div>++ {/* Investment Thesis */}+ <div style={{ marginBottom: '16px' }}>+ <div style={{ color: BLOOMBERG_ORANGE, fontSize: '12px', fontWeight: 'bold', marginBottom: '6px' }}>+ INVESTMENT THESIS & KEY POINTS+ </div>+ <div style={{ fontSize: '10px', lineHeight: '1.6' }}>+ {currentStock.keyPoints.map((point, index) => (+ <div key={index} style={{+ marginBottom: '6px',+ padding: '6px',+ backgroundColor: 'rgba(255,255,255,0.02)',+ borderLeft: `3px solid ${BLOOMBERG_GREEN}`+ }}>+ <span style={{ color: BLOOMBERG_YELLOW, marginRight: '6px' }}>▸</span>+ <span style={{ color: BLOOMBERG_WHITE }}>{point}</span>+ </div>+ ))}+ </div>+ </div>++ {/* Catalysts */}+ <div style={{ marginBottom: '16px' }}>+ <div style={{ color: BLOOMBERG_GREEN, fontSize: '12px', fontWeight: 'bold', marginBottom: '6px' }}>+ KEY CATALYSTS & POSITIVE DRIVERS+ </div>+ <div style={{ fontSize: '10px', lineHeight: '1.5' }}>+ {currentStock.catalysts.map((catalyst, index) => (+ <div key={index} style={{+ marginBottom: '4px',+ padding: '4px 6px',+ backgroundColor: 'rgba(0,200,0,0.05)',+ borderLeft: `2px solid ${BLOOMBERG_GREEN}`+ }}>+ <span style={{ color: BLOOMBERG_GREEN, marginRight: '6px' }}>✓</span>+ <span style={{ color: BLOOMBERG_WHITE }}>{catalyst}</span>+ </div>+ ))}+ </div>+ </div>++ {/* Risks */}+ <div style={{ marginBottom: '16px' }}>+ <div style={{ color: BLOOMBERG_RED, fontSize: '12px', fontWeight: 'bold', marginBottom: '6px' }}>+ KEY RISKS & CONCERNS+ </div>+ <div style={{ fontSize: '10px', lineHeight: '1.5' }}>+ {currentStock.risks.map((risk, index) => (+ <div key={index} style={{+ marginBottom: '4px',+ padding: '4px 6px',+ backgroundColor: 'rgba(255,0,0,0.05)',+ borderLeft: `2px solid ${BLOOMBERG_RED}`+ }}>+ <span style={{ color: BLOOMBERG_RED, marginRight: '6px' }}>⚠</span>+ <span style={{ color: BLOOMBERG_WHITE }}>{risk}</span>+ </div>+ ))}+ </div>+ </div>++ {/* Valuation Summary */}+ <div>+ <div style={{ color: BLOOMBERG_CYAN, fontSize: '12px', fontWeight: 'bold', marginBottom: '6px' }}>+ VALUATION ANALYSIS+ </div>+ <div style={{+ display: 'grid',+ gridTemplateColumns: '2fr 1fr 1fr',+ gap: '2px',+ fontSize: '10px',+ marginBottom: '6px'+ }}>+ <div style={{ color: BLOOMBERG_GRAY, fontWeight: 'bold', padding: '4px', backgroundColor: 'rgba(255,255,255,0.05)' }}>+ METHODOLOGY+ </div>+ <div style={{ color: BLOOMBERG_GRAY, fontWeight: 'bold', padding: '4px', backgroundColor: 'rgba(255,255,255,0.05)' }}>+ VALUE+ </div>+ <div style={{ color: BLOOMBERG_GRAY, fontWeight: 'bold', padding: '4px', backgroundColor: 'rgba(255,255,255,0.05)' }}>+ WEIGHT+ </div>+ </div>+ {valuationModels.map((model, index) => (+ <div key={index} style={{+ display: 'grid',+ gridTemplateColumns: '2fr 1fr 1fr',+ gap: '2px',+ fontSize: '10px',+ marginBottom: '2px'+ }}>+ <div style={{ color: BLOOMBERG_WHITE, padding: '4px', backgroundColor: 'rgba(255,255,255,0.02)' }}>+ {model.method}+ </div>+ <div style={{ color: BLOOMBERG_CYAN, padding: '4px', backgroundColor: 'rgba(255,255,255,0.02)' }}>+ ${model.value.toFixed(2)}+ </div>+ <div style={{ color: BLOOMBERG_YELLOW, padding: '4px', backgroundColor: 'rgba(255,255,255,0.02)' }}>+ {model.weight}%+ </div>+ </div>+ ))}+ <div style={{+ display: 'grid',+ gridTemplateColumns: '2fr 1fr 1fr',+ gap: '2px',+ fontSize: '11px',+ marginTop: '6px',+ fontWeight: 'bold'+ }}>+ <div style={{ color: BLOOMBERG_ORANGE, padding: '6px', backgroundColor: 'rgba(255,165,0,0.1)' }}>+ WEIGHTED AVERAGE TARGET+ </div>+ <div style={{ color: BLOOMBERG_GREEN, padding: '6px', backgroundColor: 'rgba(255,165,0,0.1)' }}>+ ${currentStock.target.toFixed(2)}+ </div>+ <div style={{ color: BLOOMBERG_GREEN, padding: '6px', backgroundColor: 'rgba(255,165,0,0.1)' }}>+ 100%+ </div>+ </div>+ </div>+ </div>++ {/* Right Panel - Additional Data */}+ <div style={{+ width: '320px',+ backgroundColor: BLOOMBERG_PANEL_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '4px',+ overflow: 'auto'+ }}>+ <div style={{ color: BLOOMBERG_ORANGE, fontSize: '11px', fontWeight: 'bold', marginBottom: '4px' }}>+ PEER COMPARISON+ </div>+ <div style={{ borderBottom: `1px solid ${BLOOMBERG_GRAY}`, marginBottom: '8px' }}></div>++ <div style={{+ display: 'grid',+ gridTemplateColumns: '1fr 1fr 1fr 1fr 1fr 1fr',+ gap: '2px',+ fontSize: '8px',+ marginBottom: '4px'+ }}>+ <div style={{ color: BLOOMBERG_GRAY, fontWeight: 'bold' }}>TICKER</div>+ <div style={{ color: BLOOMBERG_GRAY, fontWeight: 'bold' }}>P/E</div>+ <div style={{ color: BLOOMBERG_GRAY, fontWeight: 'bold' }}>FWD P/E</div>+ <div style={{ color: BLOOMBERG_GRAY, fontWeight: 'bold' }}>PEG</div>+ <div style={{ color: BLOOMBERG_GRAY, fontWeight: 'bold' }}>ROE</div>+ <div style={{ color: BLOOMBERG_GRAY, fontWeight: 'bold' }}>D/E</div>+ </div>++ {peerComparison.map((peer, index) => (+ <div key={index} style={{+ display: 'grid',+ gridTemplateColumns: '1fr 1fr 1fr 1fr 1fr 1fr',+ gap: '2px',+ fontSize: '9px',+ marginBottom: '2px',+ padding: '2px',+ backgroundColor: peer.ticker === selectedStock ? 'rgba(255,165,0,0.1)' : 'rgba(255,255,255,0.02)'+ }}>+ <div style={{ color: BLOOMBERG_WHITE, fontWeight: 'bold' }}>{peer.ticker}</div>+ <div style={{ color: BLOOMBERG_CYAN }}>{peer.pe.toFixed(1)}</div>+ <div style={{ color: BLOOMBERG_CYAN }}>{peer.fwdPE.toFixed(1)}</div>+ <div style={{ color: BLOOMBERG_YELLOW }}>{peer.pegRatio.toFixed(1)}</div>+ <div style={{ color: BLOOMBERG_GREEN }}>{peer.roe.toFixed(1)}%</div>+ <div style={{ color: BLOOMBERG_WHITE }}>{peer.debtEquity.toFixed(2)}</div>+ </div>+ ))}++ <div style={{ borderTop: `1px solid ${BLOOMBERG_GRAY}`, marginTop: '12px', paddingTop: '8px' }}>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '10px', fontWeight: 'bold', marginBottom: '6px' }}>+ ANALYST CONSENSUS+ </div>+ <div style={{ fontSize: '9px', lineHeight: '1.5' }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '3px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Strong Buy:</span>+ <span style={{ color: BLOOMBERG_GREEN }}>18 (62%)</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '3px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Buy:</span>+ <span style={{ color: BLOOMBERG_CYAN }}>8 (28%)</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '3px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Hold:</span>+ <span style={{ color: BLOOMBERG_YELLOW }}>3 (10%)</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '3px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Sell:</span>+ <span style={{ color: BLOOMBERG_ORANGE }}>0 (0%)</span>+ </div>+ <div style={{ borderTop: `1px solid ${BLOOMBERG_GRAY}`, marginTop: '6px', paddingTop: '6px' }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '3px' }}>+ <span style={{ color: BLOOMBERG_CYAN }}>Avg Target:</span>+ <span style={{ color: BLOOMBERG_GREEN, fontWeight: 'bold' }}>${currentStock.target.toFixed(2)}</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '3px' }}>+ <span style={{ color: BLOOMBERG_CYAN }}>High Target:</span>+ <span style={{ color: BLOOMBERG_GREEN }}>${(currentStock.target * 1.15).toFixed(2)}</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: BLOOMBERG_CYAN }}>Low Target:</span>+ <span style={{ color: BLOOMBERG_RED }}>${(currentStock.target * 0.85).toFixed(2)}</span>+ </div>+ </div>+ </div>+ </div>++ <div style={{ borderTop: `1px solid ${BLOOMBERG_GRAY}`, marginTop: '12px', paddingTop: '8px' }}>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '10px', fontWeight: 'bold', marginBottom: '6px' }}>+ EARNINGS ESTIMATES+ </div>+ <div style={{ fontSize: '9px' }}>+ <div style={{ marginBottom: '6px' }}>+ <div style={{ color: BLOOMBERG_GRAY, marginBottom: '2px' }}>Q1 2024 (Current)</div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: BLOOMBERG_WHITE }}>EPS Est:</span>+ <span style={{ color: BLOOMBERG_CYAN }}>$1.62</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: BLOOMBERG_WHITE }}>Revenue Est:</span>+ <span style={{ color: BLOOMBERG_CYAN }}>$96.5B</span>+ </div>+ </div>+ <div style={{ marginBottom: '6px' }}>+ <div style={{ color: BLOOMBERG_GRAY, marginBottom: '2px' }}>FY 2024</div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: BLOOMBERG_WHITE }}>EPS Est:</span>+ <span style={{ color: BLOOMBERG_CYAN }}>$6.78</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: BLOOMBERG_WHITE }}>Revenue Est:</span>+ <span style={{ color: BLOOMBERG_CYAN }}>$402.8B</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: BLOOMBERG_WHITE }}>Growth:</span>+ <span style={{ color: BLOOMBERG_GREEN }}>+12.4%</span>+ </div>+ </div>+ <div>+ <div style={{ color: BLOOMBERG_GRAY, marginBottom: '2px' }}>FY 2025</div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: BLOOMBERG_WHITE }}>EPS Est:</span>+ <span style={{ color: BLOOMBERG_CYAN }}>$7.48</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: BLOOMBERG_WHITE }}>Revenue Est:</span>+ <span style={{ color: BLOOMBERG_CYAN }}>$445.2B</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: BLOOMBERG_WHITE }}>Growth:</span>+ <span style={{ color: BLOOMBERG_GREEN }}>+10.5%</span>+ </div>+ </div>+ </div>+ </div>++ <div style={{ borderTop: `1px solid ${BLOOMBERG_GRAY}`, marginTop: '12px', paddingTop: '8px' }}>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '10px', fontWeight: 'bold', marginBottom: '6px' }}>+ INSTITUTIONAL OWNERSHIP+ </div>+ <div style={{ fontSize: '9px', lineHeight: '1.5' }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Total Institutions:</span>+ <span style={{ color: BLOOMBERG_WHITE }}>4,847</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>% Outstanding:</span>+ <span style={{ color: BLOOMBERG_CYAN }}>62.3%</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Q/Q Change:</span>+ <span style={{ color: BLOOMBERG_GREEN }}>+2.4%</span>+ </div>+ <div style={{ color: BLOOMBERG_GRAY, marginTop: '6px', marginBottom: '4px' }}>Top Holders:</div>+ <div style={{ fontSize: '8px' }}>+ <div>1. Vanguard Group (8.2%)</div>+ <div>2. BlackRock (6.7%)</div>+ <div>3. State Street (4.1%)</div>+ <div>4. Berkshire Hathaway (3.8%)</div>+ <div>5. Fidelity (2.9%)</div>+ </div>+ </div>+ </div>+ </div>+ </div>+ </div>++ {/* Status Bar */}+ <div style={{+ borderTop: `1px solid ${BLOOMBERG_GRAY}`,+ backgroundColor: BLOOMBERG_PANEL_BG,+ padding: '2px 8px',+ fontSize: '10px',+ color: BLOOMBERG_GRAY,+ flexShrink: 0+ }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>+ <div style={{ display: 'flex', gap: '16px' }}>+ <span>Fincept Equity Research Terminal v3.2.1 | Professional analyst coverage</span>+ <span>Coverage: 5,234 stocks | Reports: {researchCount.toLocaleString()} | Analysts: 3,847</span>+ </div>+ <div style={{ display: 'flex', gap: '16px' }}>+ <span>Viewing: {selectedStock}</span>+ <span>Section: {activeView}</span>+ <span style={{ color: BLOOMBERG_GREEN }}>DATA: LIVE</span>+ </div>+ </div>+ </div>+ </div>+ );+};++export default EquityResearchTab;\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/tabs/FixedIncomeTab.tsx b/fincept-terminal-desktop/src/components/tabs/FixedIncomeTab.tsxnew file mode 100644index 000000000..a6be53533--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/FixedIncomeTab.tsx@@ -0,0 +1,525 @@+import React, { useState, useEffect } from 'react';++interface Bond {+ ticker: string;+ issuer: string;+ coupon: number;+ maturity: string;+ yield: number;+ price: number;+ duration: number;+ rating: string;+ type: 'TREASURY' | 'CORPORATE' | 'MUNICIPAL' | 'AGENCY';+ sector: string;+ callDate?: string;+ ytm: number;+ yieldChange: number;+ volume: string;+ spread: number;+}++const FixedIncomeTab: React.FC = () => {+ const [currentTime, setCurrentTime] = useState(new Date());+ const [selectedType, setSelectedType] = useState('ALL');+ const [selectedRating, setSelectedRating] = useState('ALL');++ const COLOR_ORANGE = '#FFA500';+ const COLOR_WHITE = '#FFFFFF';+ const COLOR_RED = '#FF0000';+ const COLOR_GREEN = '#00C800';+ const COLOR_YELLOW = '#FFFF00';+ const COLOR_GRAY = '#787878';+ const COLOR_BLUE = '#6496FA';+ const COLOR_PURPLE = '#C864FF';+ const COLOR_CYAN = '#00FFFF';+ const COLOR_DARK_BG = '#000000';+ const COLOR_PANEL_BG = '#0a0a0a';++ useEffect(() => {+ const timer = setInterval(() => setCurrentTime(new Date()), 1000);+ return () => clearInterval(timer);+ }, []);++ const bonds: Bond[] = [+ {+ ticker: 'US10Y',+ issuer: 'US Treasury',+ coupon: 4.125,+ maturity: '2034-02-15',+ yield: 4.234,+ price: 98.75,+ duration: 8.4,+ rating: 'AAA',+ type: 'TREASURY',+ sector: 'Government',+ ytm: 4.234,+ yieldChange: 0.023,+ volume: '$12.5B',+ spread: 0+ },+ {+ ticker: 'US2Y',+ issuer: 'US Treasury',+ coupon: 4.625,+ maturity: '2026-11-30',+ yield: 4.156,+ price: 99.82,+ duration: 1.9,+ rating: 'AAA',+ type: 'TREASURY',+ sector: 'Government',+ ytm: 4.156,+ yieldChange: 0.012,+ volume: '$8.2B',+ spread: 0+ },+ {+ ticker: 'AAPL 3.2',+ issuer: 'Apple Inc',+ coupon: 3.200,+ maturity: '2029-05-11',+ yield: 4.456,+ price: 94.23,+ duration: 4.8,+ rating: 'AA+',+ type: 'CORPORATE',+ sector: 'Technology',+ callDate: '2027-05-11',+ ytm: 4.456,+ yieldChange: 0.034,+ volume: '$450M',+ spread: 98+ },+ {+ ticker: 'JPM 3.875',+ issuer: 'JPMorgan Chase',+ coupon: 3.875,+ maturity: '2032-09-10',+ yield: 4.789,+ price: 91.45,+ duration: 7.2,+ rating: 'A+',+ type: 'CORPORATE',+ sector: 'Financials',+ ytm: 4.789,+ yieldChange: 0.045,+ volume: '$380M',+ spread: 112+ },+ {+ ticker: 'MSFT 2.675',+ issuer: 'Microsoft Corp',+ coupon: 2.675,+ maturity: '2030-06-01',+ yield: 4.234,+ price: 89.67,+ duration: 5.6,+ rating: 'AAA',+ type: 'CORPORATE',+ sector: 'Technology',+ callDate: '2028-06-01',+ ytm: 4.234,+ yieldChange: 0.028,+ volume: '$520M',+ spread: 87+ },+ {+ ticker: 'XOM 4.114',+ issuer: 'Exxon Mobil',+ coupon: 4.114,+ maturity: '2046-03-01',+ yield: 5.123,+ price: 87.34,+ duration: 14.3,+ rating: 'AA',+ type: 'CORPORATE',+ sector: 'Energy',+ ytm: 5.123,+ yieldChange: 0.056,+ volume: '$290M',+ spread: 145+ },+ {+ ticker: 'TSLA 5.3',+ issuer: 'Tesla Inc',+ coupon: 5.300,+ maturity: '2028-08-15',+ yield: 6.234,+ price: 95.12,+ duration: 3.8,+ rating: 'BB+',+ type: 'CORPORATE',+ sector: 'Consumer Discretionary',+ ytm: 6.234,+ yieldChange: 0.089,+ volume: '$180M',+ spread: 234+ },+ {+ ticker: 'BAC 4.45',+ issuer: 'Bank of America',+ coupon: 4.450,+ maturity: '2031-03-03',+ yield: 4.923,+ price: 93.78,+ duration: 6.4,+ rating: 'A',+ type: 'CORPORATE',+ sector: 'Financials',+ ytm: 4.923,+ yieldChange: 0.041,+ volume: '$340M',+ spread: 128+ }+ ];++ const yieldCurveData = [+ { maturity: '1M', yield: 5.234, label: '1 Month' },+ { maturity: '3M', yield: 5.123, label: '3 Month' },+ { maturity: '6M', yield: 4.987, label: '6 Month' },+ { maturity: '1Y', yield: 4.756, label: '1 Year' },+ { maturity: '2Y', yield: 4.156, label: '2 Year' },+ { maturity: '5Y', yield: 3.987, label: '5 Year' },+ { maturity: '10Y', yield: 4.234, label: '10 Year' },+ { maturity: '30Y', yield: 4.523, label: '30 Year' }+ ];++ const creditSpreads = [+ { rating: 'AAA', spread: 45, change: 2 },+ { rating: 'AA', spread: 78, change: 3 },+ { rating: 'A', spread: 112, change: 5 },+ { rating: 'BBB', spread: 165, change: 8 },+ { rating: 'BB', spread: 234, change: 12 },+ { rating: 'B', spread: 389, change: 18 }+ ];++ const filteredBonds = bonds.filter(b =>+ (selectedType === 'ALL' || b.type === selectedType) &&+ (selectedRating === 'ALL' || b.rating.startsWith(selectedRating))+ );++ const getTypeColor = (type: string) => {+ switch(type) {+ case 'TREASURY': return COLOR_BLUE;+ case 'CORPORATE': return COLOR_GREEN;+ case 'MUNICIPAL': return COLOR_PURPLE;+ case 'AGENCY': return COLOR_CYAN;+ default: return COLOR_WHITE;+ }+ };++ const getRatingColor = (rating: string) => {+ if (rating.startsWith('AA')) return COLOR_GREEN;+ if (rating.startsWith('A')) return COLOR_CYAN;+ if (rating.startsWith('BB')) return COLOR_YELLOW;+ if (rating.startsWith('B')) return COLOR_ORANGE;+ return COLOR_RED;+ };++ return (+ <div style={{+ height: '100%',+ backgroundColor: COLOR_DARK_BG,+ color: COLOR_WHITE,+ fontFamily: 'Consolas, monospace',+ overflow: 'hidden',+ display: 'flex',+ flexDirection: 'column',+ fontSize: '12px'+ }}>+ {/* Header */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ borderBottom: `2px solid ${COLOR_GRAY}`,+ padding: '8px 16px',+ flexShrink: 0+ }}>+ <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>+ <span style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '16px' }}>+ FIXED INCOME MARKETS+ </span>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <span style={{ color: COLOR_CYAN }}>US TREASURIES • CORPORATES • CREDIT</span>+ </div>+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>+ <span style={{ color: COLOR_GRAY, fontSize: '11px' }}>+ LAST UPDATE: {currentTime.toLocaleTimeString()}+ </span>+ </div>+ </div>+ </div>++ {/* Main Content */}+ <div style={{ flex: 1, overflow: 'auto', display: 'flex', gap: '12px', padding: '12px' }}>+ {/* Left Panel - Yield Curve & Spreads */}+ <div style={{ width: '320px', display: 'flex', flexDirection: 'column', gap: '12px' }}>+ {/* Yield Curve */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ border: `2px solid ${COLOR_GRAY}`,+ borderLeft: `6px solid ${COLOR_BLUE}`,+ padding: '12px'+ }}>+ <div style={{ color: COLOR_ORANGE, fontSize: '13px', fontWeight: 'bold', marginBottom: '12px' }}>+ US TREASURY YIELD CURVE+ </div>+ <div style={{ display: 'flex', flexDirection: 'column', gap: '6px' }}>+ {yieldCurveData.map((point, index) => (+ <div key={index} style={{+ display: 'flex',+ justifyContent: 'space-between',+ alignItems: 'center',+ padding: '6px 8px',+ backgroundColor: index % 2 === 0 ? 'rgba(255,255,255,0.02)' : 'transparent'+ }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px' }}>+ <span style={{ color: COLOR_GRAY, fontSize: '11px', width: '60px' }}>+ {point.label}+ </span>+ <div style={{+ width: `${point.yield * 15}px`,+ height: '16px',+ backgroundColor: COLOR_BLUE,+ opacity: 0.7+ }} />+ </div>+ <span style={{ color: COLOR_CYAN, fontSize: '12px', fontWeight: 'bold' }}>+ {point.yield.toFixed(3)}%+ </span>+ </div>+ ))}+ </div>+ </div>++ {/* Credit Spreads */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ border: `2px solid ${COLOR_GRAY}`,+ borderLeft: `6px solid ${COLOR_YELLOW}`,+ padding: '12px'+ }}>+ <div style={{ color: COLOR_ORANGE, fontSize: '13px', fontWeight: 'bold', marginBottom: '12px' }}>+ CREDIT SPREADS (OAS)+ </div>+ <div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>+ {creditSpreads.map((spread, index) => (+ <div key={index} style={{+ padding: '8px',+ backgroundColor: 'rgba(255,255,255,0.02)',+ border: `1px solid ${COLOR_GRAY}`+ }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '4px' }}>+ <span style={{ color: getRatingColor(spread.rating), fontWeight: 'bold', fontSize: '11px' }}>+ {spread.rating}+ </span>+ <span style={{ color: COLOR_CYAN, fontWeight: 'bold', fontSize: '11px' }}>+ {spread.spread} bps+ </span>+ </div>+ <div style={{ fontSize: '10px', color: spread.change > 0 ? COLOR_RED : COLOR_GREEN }}>+ {spread.change > 0 ? '▲' : '▼'} {Math.abs(spread.change)} bps+ </div>+ </div>+ ))}+ </div>+ </div>++ {/* Key Metrics */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ border: `2px solid ${COLOR_GRAY}`,+ borderLeft: `6px solid ${COLOR_GREEN}`,+ padding: '12px'+ }}>+ <div style={{ color: COLOR_ORANGE, fontSize: '13px', fontWeight: 'bold', marginBottom: '12px' }}>+ KEY METRICS+ </div>+ <div style={{ display: 'flex', flexDirection: 'column', gap: '8px', fontSize: '11px' }}>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: COLOR_GRAY }}>10Y-2Y Spread:</span>+ <span style={{ color: COLOR_CYAN, fontWeight: 'bold' }}>78 bps</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: COLOR_GRAY }}>Fed Funds Rate:</span>+ <span style={{ color: COLOR_GREEN, fontWeight: 'bold' }}>5.50%</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: COLOR_GRAY }}>Inflation (CPI):</span>+ <span style={{ color: COLOR_YELLOW, fontWeight: 'bold' }}>3.2%</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: COLOR_GRAY }}>Real Yield (10Y):</span>+ <span style={{ color: COLOR_PURPLE, fontWeight: 'bold' }}>1.03%</span>+ </div>+ </div>+ </div>+ </div>++ {/* Right Panel - Bond List */}+ <div style={{ flex: 1, display: 'flex', flexDirection: 'column' }}>+ {/* Filters */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ border: `2px solid ${COLOR_GRAY}`,+ padding: '12px',+ marginBottom: '12px'+ }}>+ <div style={{ display: 'flex', gap: '12px', alignItems: 'center' }}>+ <span style={{ color: COLOR_GRAY, fontSize: '11px' }}>TYPE:</span>+ {['ALL', 'TREASURY', 'CORPORATE', 'MUNICIPAL', 'AGENCY'].map((type) => (+ <button key={type}+ onClick={() => setSelectedType(type)}+ style={{+ padding: '6px 12px',+ backgroundColor: selectedType === type ? COLOR_ORANGE : COLOR_DARK_BG,+ border: `2px solid ${selectedType === type ? COLOR_ORANGE : COLOR_GRAY}`,+ color: selectedType === type ? COLOR_DARK_BG : COLOR_WHITE,+ fontSize: '10px',+ fontWeight: 'bold',+ cursor: 'pointer',+ fontFamily: 'Consolas, monospace'+ }}>+ {type}+ </button>+ ))}+ <span style={{ color: COLOR_GRAY, marginLeft: '16px' }}>|</span>+ <span style={{ color: COLOR_GRAY, fontSize: '11px' }}>RATING:</span>+ {['ALL', 'AAA', 'AA', 'A', 'BBB', 'BB'].map((rating) => (+ <button key={rating}+ onClick={() => setSelectedRating(rating)}+ style={{+ padding: '6px 12px',+ backgroundColor: selectedRating === rating ? COLOR_CYAN : COLOR_DARK_BG,+ border: `2px solid ${selectedRating === rating ? COLOR_CYAN : COLOR_GRAY}`,+ color: selectedRating === rating ? COLOR_DARK_BG : COLOR_WHITE,+ fontSize: '10px',+ fontWeight: 'bold',+ cursor: 'pointer',+ fontFamily: 'Consolas, monospace'+ }}>+ {rating}+ </button>+ ))}+ </div>+ </div>++ {/* Bond Table */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ border: `2px solid ${COLOR_GRAY}`,+ flex: 1,+ overflow: 'auto'+ }}>+ {/* Table Header */}+ <div style={{+ display: 'grid',+ gridTemplateColumns: '100px 180px 80px 100px 80px 80px 70px 60px 80px 80px',+ padding: '10px 12px',+ backgroundColor: 'rgba(255,165,0,0.1)',+ borderBottom: `2px solid ${COLOR_ORANGE}`,+ position: 'sticky',+ top: 0,+ zIndex: 10+ }}>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '10px' }}>TICKER</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '10px' }}>ISSUER</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '10px' }}>COUPON</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '10px' }}>MATURITY</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '10px' }}>YIELD</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '10px' }}>PRICE</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '10px' }}>RATING</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '10px' }}>DUR</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '10px' }}>SPREAD</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '10px' }}>VOLUME</div>+ </div>++ {/* Table Body */}+ {filteredBonds.map((bond, index) => (+ <div key={index}+ style={{+ display: 'grid',+ gridTemplateColumns: '100px 180px 80px 100px 80px 80px 70px 60px 80px 80px',+ padding: '10px 12px',+ backgroundColor: index % 2 === 0 ? 'rgba(255,255,255,0.02)' : 'transparent',+ borderBottom: `1px solid ${COLOR_GRAY}`,+ cursor: 'pointer',+ fontSize: '11px'+ }}+ onMouseEnter={(e) => {+ e.currentTarget.style.backgroundColor = 'rgba(255,165,0,0.1)';+ }}+ onMouseLeave={(e) => {+ e.currentTarget.style.backgroundColor = index % 2 === 0 ? 'rgba(255,255,255,0.02)' : 'transparent';+ }}>+ <div style={{ color: getTypeColor(bond.type), fontWeight: 'bold' }}>{bond.ticker}</div>+ <div style={{ color: COLOR_WHITE }}>{bond.issuer}</div>+ <div style={{ color: COLOR_CYAN }}>{bond.coupon.toFixed(3)}%</div>+ <div style={{ color: COLOR_GRAY }}>{bond.maturity}</div>+ <div>+ <div style={{ color: COLOR_YELLOW, fontWeight: 'bold' }}>{bond.yield.toFixed(3)}%</div>+ <div style={{ color: bond.yieldChange > 0 ? COLOR_RED : COLOR_GREEN, fontSize: '9px' }}>+ {bond.yieldChange > 0 ? '▲' : '▼'} {Math.abs(bond.yieldChange).toFixed(3)}%+ </div>+ </div>+ <div style={{ color: COLOR_WHITE }}>{bond.price.toFixed(2)}</div>+ <div style={{ color: getRatingColor(bond.rating), fontWeight: 'bold' }}>{bond.rating}</div>+ <div style={{ color: COLOR_PURPLE }}>{bond.duration.toFixed(1)}</div>+ <div style={{ color: bond.spread > 150 ? COLOR_RED : COLOR_GREEN }}>+ {bond.spread > 0 ? `+${bond.spread}` : '-'}+ </div>+ <div style={{ color: COLOR_GRAY }}>{bond.volume}</div>+ </div>+ ))}+ </div>+ </div>+ </div>++ {/* Footer */}+ <div style={{+ borderTop: `3px solid ${COLOR_ORANGE}`,+ backgroundColor: COLOR_PANEL_BG,+ padding: '12px 16px',+ fontSize: '11px',+ color: COLOR_WHITE,+ flexShrink: 0+ }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '8px' }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '16px' }}>+ <span style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '13px' }}>+ FIXED INCOME v1.0+ </span>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <span style={{ color: COLOR_CYAN }}>+ Real-time bond prices & yields+ </span>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <span style={{ color: COLOR_GREEN }}>+ Showing: {filteredBonds.length} bonds+ </span>+ </div>+ </div>+ <div style={{+ display: 'flex',+ justifyContent: 'space-between',+ fontSize: '10px',+ paddingTop: '8px',+ borderTop: `1px solid ${COLOR_GRAY}`+ }}>+ <div style={{ display: 'flex', gap: '16px' }}>+ <span style={{ color: COLOR_GRAY }}><span style={{ color: COLOR_BLUE }}>F1</span> Help</span>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <span style={{ color: COLOR_GRAY }}><span style={{ color: COLOR_BLUE }}>F2</span> Export</span>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <span style={{ color: COLOR_GRAY }}><span style={{ color: COLOR_BLUE }}>F3</span> Calculator</span>+ </div>+ <div style={{ color: COLOR_GRAY }}>+ © 2025 Fincept Labs • All Rights Reserved+ </div>+ </div>+ </div>+ </div>+ );+};++export default FixedIncomeTab;\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/tabs/ForumTab.tsx b/fincept-terminal-desktop/src/components/tabs/ForumTab.tsxindex 1a0df0f92..47f38b34d 100644--- a/fincept-terminal-desktop/src/components/tabs/ForumTab.tsx+++ b/fincept-terminal-desktop/src/components/tabs/ForumTab.tsx@@ -1,890 +1,598 @@-// File: src/components/tabs/ForumTab.tsx-// Forum UI component with Bloomberg terminal styling-import React, { useState, useEffect } from 'react';-import { Button } from '@/components/ui/button';-import { Input } from '@/components/ui/input';-import { Label } from '@/components/ui/label';-import { Badge } from '@/components/ui/badge';-import { Textarea } from '@/components/ui/textarea';-import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';-import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from '@/components/ui/dialog';-import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';-import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';-import { Separator } from '@/components/ui/separator';-import { ScrollArea } from '@/components/ui/scroll-area';-import {- Search,- Plus,- TrendingUp,- Clock,- MessageSquare,- Eye,- ThumbsUp,- ThumbsDown,- Pin,- RefreshCw,- HelpCircle,- User-} from 'lucide-react';--import { useAuth } from '@/contexts/AuthContext';-import {- ForumApiService,- ForumCategory,- ForumPost,- ForumComment,- ForumStats,- ForumUtils-} from '@/services/forumApi';--interface ForumTabProps {}--const ForumTab: React.FC<ForumTabProps> = () => {- const { session } = useAuth();-- // State management- const [categories, setCategories] = useState<ForumCategory[]>([]);- const [posts, setPosts] = useState<ForumPost[]>([]);- const [stats, setStats] = useState<ForumStats | null>(null);- const [selectedCategory, setSelectedCategory] = useState<number | null>(null);- const [currentCategoryName, setCurrentCategoryName] = useState<string>('All Categories');- const [searchQuery, setSearchQuery] = useState<string>('');- const [sortBy, setSortBy] = useState<string>('latest');- const [loading, setLoading] = useState<boolean>(false);- const [error, setError] = useState<string>('');-- // Post creation state- const [showCreatePost, setShowCreatePost] = useState<boolean>(false);- const [newPostTitle, setNewPostTitle] = useState<string>('');- const [newPostContent, setNewPostContent] = useState<string>('');- const [newPostCategory, setNewPostCategory] = useState<string>('');- const [createPostLoading, setCreatePostLoading] = useState<boolean>(false);-- // Post details state- const [selectedPost, setSelectedPost] = useState<ForumPost | null>(null);- const [postComments, setPostComments] = useState<ForumComment[]>([]);- const [showPostDetails, setShowPostDetails] = useState<boolean>(false);- const [newComment, setNewComment] = useState<string>('');- const [commentLoading, setCommentLoading] = useState<boolean>(false);-- // Bloomberg terminal colors- const colors = {- orange: '#ea580c',- white: '#ffffff',- red: '#ef4444',- green: '#22c55e',- yellow: '#eab308',- gray: '#64748b',- blue: '#3b82f6',- purple: '#8b5cf6'- };- // Authentication check- const isAuthenticated = session?.authenticated || false;- const apiKey = session?.api_key || undefined;- const deviceId = session?.device_id || undefined;+interface ForumPost {+ id: string;+ time: string;+ author: string;+ title: string;+ content: string;+ category: string;+ tags: string[];+ views: number;+ replies: number;+ likes: number;+ sentiment: 'BULLISH' | 'BEARISH' | 'NEUTRAL';+ priority: 'HOT' | 'TRENDING' | 'NORMAL';+ verified: boolean;+}++interface ForumUser {+ username: string;+ reputation: number;+ posts: number;+ joined: string;+ status: 'ONLINE' | 'OFFLINE';+}++const ForumTab: React.FC = () => {+ const [currentTime, setCurrentTime] = useState(new Date());+ const [activeCategory, setActiveCategory] = useState('ALL');+ const [sortBy, setSortBy] = useState('LATEST');+ const [onlineUsers, setOnlineUsers] = useState(1247);++ // Bloomberg color scheme+ const BLOOMBERG_ORANGE = '#FFA500';+ const BLOOMBERG_WHITE = '#FFFFFF';+ const BLOOMBERG_RED = '#FF0000';+ const BLOOMBERG_GREEN = '#00C800';+ const BLOOMBERG_YELLOW = '#FFFF00';+ const BLOOMBERG_GRAY = '#787878';+ const BLOOMBERG_BLUE = '#6496FA';+ const BLOOMBERG_PURPLE = '#C864FF';+ const BLOOMBERG_CYAN = '#00FFFF';+ const BLOOMBERG_DARK_BG = '#000000';+ const BLOOMBERG_PANEL_BG = '#0a0a0a';- // Load initial datauseEffect(() => {- if (isAuthenticated || session?.user_type === 'guest') {- loadInitialData();- }- }, [isAuthenticated, session]);-- const loadInitialData = async () => {- setLoading(true);- setError('');-- try {- // Load categories and stats in parallel- const [categoriesResult, statsResult] = await Promise.all([- ForumApiService.getCategories(apiKey, deviceId),- ForumApiService.getForumStats(apiKey, deviceId)- ]);-- if (categoriesResult.success && categoriesResult.data?.success) {- const categoriesData = categoriesResult.data.data.categories;- setCategories(categoriesData);-- // Load posts from first category or all posts- if (categoriesData.length > 0) {- loadPosts(categoriesData[0].id, categoriesData[0].name);- } else {- loadAllPosts();- }- }-- if (statsResult.success && statsResult.data?.success) {- setStats(statsResult.data.data);- }- } catch (err) {- setError('Failed to load forum data. Please try again.');- console.error('Forum data loading failed:', err);- } finally {- setLoading(false);- }- };-- const loadPosts = async (categoryId?: number, categoryName?: string) => {- setLoading(true);- setError('');-- try {- let result;-- if (categoryId) {- result = await ForumApiService.getPostsByCategory(- categoryId,- sortBy,- 20,- apiKey,- deviceId- );- setSelectedCategory(categoryId);- setCurrentCategoryName(categoryName || 'Unknown Category');- } else {- result = await ForumApiService.getAllPosts(sortBy, 20, apiKey, deviceId);- setSelectedCategory(null);- setCurrentCategoryName('All Categories');- }-- if (result.success && result.data?.success) {- const postsData = result.data.data.posts || [];- setPosts(postsData);- } else {- throw new Error(result.error || 'Failed to load posts');- }- } catch (err) {- setError('Failed to load posts. Please try again.');- console.error('Posts loading failed:', err);- } finally {- setLoading(false);- }- };-- const loadAllPosts = () => {- loadPosts();- };-- const handleSearch = async () => {- if (!searchQuery.trim()) return;-- setLoading(true);- setError('');-- try {- const result = await ForumApiService.searchPosts(- searchQuery,- 'all',- 20,- apiKey,- deviceId- );-- if (result.success && result.data?.success) {- const searchResults = result.data.data.results.posts || [];- setPosts(searchResults);- setCurrentCategoryName(`Search: "${searchQuery}"`);- setSelectedCategory(null);- } else {- throw new Error(result.error || 'Search failed');- }- } catch (err) {- setError('Search failed. Please try again.');- console.error('Search failed:', err);- } finally {- setLoading(false);- }- };-- const handleVote = async (postUuid: string, voteType: 'up' | 'down') => {- if (!isAuthenticated) {- setError('You must be logged in to vote');- return;- }-- try {- const result = await ForumApiService.voteOnPost(- postUuid,- voteType,- apiKey!,- deviceId- );-- if (result.success && result.data?.success) {- // Refresh posts to show updated vote counts- loadPosts(selectedCategory, currentCategoryName);- } else {- throw new Error(result.error || 'Vote failed');- }- } catch (err) {- console.error('Vote failed:', err);- setError('Vote failed. Please try again.');- }- };-- const handleCreatePost = async () => {- if (!isAuthenticated) {- setError('You must be logged in to create posts');- return;- }-- const validation = ForumUtils.validatePost(newPostTitle, newPostContent);- if (!validation.valid) {- setError(validation.error!);- return;- }-- if (!newPostCategory) {- setError('Please select a category');- return;+ const timer = setInterval(() => {+ setCurrentTime(new Date());+ setOnlineUsers(prev => prev + Math.floor(Math.random() * 10) - 5);+ }, 5000);+ return () => clearInterval(timer);+ }, []);++ const forumPosts: ForumPost[] = [+ {+ id: '1',+ time: '16:52:18',+ author: 'QuantTrader_Pro',+ title: 'Fed Rate Decision Analysis - 75bps Cut Implications for Q2 2024',+ content: 'Deep analysis of the Federal Reserve\'s emergency rate cut decision. Historical precedents from 2008 and 2020 suggest this could trigger a sustained equity rally. My quant models show S&P 500 has 78% probability of hitting 4,950 within 30 days. Key sectors to watch: Tech (AI infrastructure), Regional Banks (benefiting from rate cuts), Real Estate (commercial REITs). However, watch for potential stagflation risks if inflation doesn\'t respond as expected. Technical analysis shows strong support at 4,750 with RSI indicating oversold conditions in previous weeks. Options market is pricing in 15% move in either direction - suggesting high uncertainty. My personal position: Long QQQ calls, Short VIX, Hedged with TLT puts.',+ category: 'MARKETS',+ tags: ['FED', 'RATES', 'ANALYSIS', 'S&P500'],+ views: 8924,+ replies: 156,+ likes: 342,+ sentiment: 'BULLISH',+ priority: 'HOT',+ verified: true+ },+ {+ id: '2',+ time: '16:48:33',+ author: 'TechInvestor88',+ title: 'NVIDIA Q4 Earnings Preview - AI Chip Demand Analysis',+ content: 'NVDA earnings expected next week. My channel checks with data center operators suggest GPU orders are up 40% QoQ. H100 chips still have 6-month waiting lists. Competition from AMD and custom chips (Google TPU, Amazon Trainium) not materially impacting market share yet. Guidance will be key - looking for $30B+ revenue guidance for FY2024. Stock trading at 45x forward earnings which seems reasonable given 50%+ revenue growth. Potential risks: export restrictions to China (20% of revenue), datacenter capex slowdown, margin compression from next-gen Blackwell chips. My play: Selling $650 puts, buying $750 calls for earnings week. High IV makes this attractive. What are your thoughts on the competitive landscape?',+ category: 'TECH',+ tags: ['NVDA', 'EARNINGS', 'AI', 'SEMICONDUCTORS'],+ views: 6234,+ replies: 89,+ likes: 278,+ sentiment: 'BULLISH',+ priority: 'TRENDING',+ verified: true+ },+ {+ id: '3',+ time: '16:45:12',+ author: 'CryptoWhale_2024',+ title: 'Bitcoin ETF Approval - Historical Analysis of Gold ETF Launch 2004',+ content: 'Now that spot BTC ETFs are approved, I did historical analysis of what happened when Gold ETF (GLD) launched in Nov 2004. Gold was at $450/oz and rallied to $1,900/oz over next 7 years (322% gain). Key differences: Gold already had massive institutional adoption, BTC is earlier in adoption curve. Similarities: Both are "digital gold" narratives, both faced regulatory skepticism, both had futures products before ETFs. My projection: BTC could see $100K within 12-18 months as institutional allocations begin. Fidelity alone has $4.5T AUM - even 1% allocation would be $45B into BTC market. However, watch for: Grayscale GBTC redemptions (discount now closed), Mt. Gox distribution, regulatory changes. I\'m holding long-term, targeting $150K by end of 2025.',+ category: 'CRYPTO',+ tags: ['BTC', 'ETF', 'INSTITUTIONS', 'GOLD'],+ views: 5823,+ replies: 142,+ likes: 401,+ sentiment: 'BULLISH',+ priority: 'HOT',+ verified: true+ },+ {+ id: '4',+ time: '16:41:45',+ author: 'EnergyAnalyst_TX',+ title: 'Saudi Arabia Production Cuts - Oil Supply Dynamics Through 2024',+ content: 'Saudi extending voluntary 1M bpd cuts through Q2. This is critical because global oil inventories are already at 5-year lows. US SPR still depleted (365M barrels vs 650M historical). Demand side: China reopening could add 1.5M bpd demand, US summer driving season approaching. Supply side: US shale growth plateauing at 13M bpd, OPEC+ discipline stronger than expected. My price targets: Brent $95-105 range for Q2/Q3, potential spike to $120 if geopolitical tensions escalate (Middle East, Russia). How to play: Long XLE (energy sector ETF), individual picks - CVX and XOM for stability + dividends, smaller E&Ps for leverage (DVN, FANG). Alternative plays: Refined products (crack spreads widening), tanker stocks (shipping rates up 40% YoY). Risks: Demand destruction above $100/bbl, surprise OPEC production increases.',+ category: 'ENERGY',+ tags: ['OIL', 'OPEC', 'COMMODITIES', 'ENERGY'],+ views: 4156,+ replies: 67,+ likes: 189,+ sentiment: 'BULLISH',+ priority: 'TRENDING',+ verified: true+ },+ {+ id: '5',+ time: '16:38:22',+ author: 'BankingInsider',+ title: 'JPMorgan Q4 Beat - What It Means for Regional Banks',+ content: 'JPM crushed earnings with $15.2B profit. Key takeaway: Net Interest Margin held up despite rate uncertainty. Credit quality remains strong (provisions down 34%). But here\'s what matters for regional banks (KRE, RF, CFG): JPM benefited from deposit flight FROM regional banks after SVB collapse. They gained $200B+ in deposits at near-zero cost. Regional banks face opposite dynamic: deposit costs up 200bps, commercial real estate exposure (office vacancy at 20%+ in major cities), wholesale funding pressure. My contrarian take: Some regional banks are now oversold. Look at tangible book value - many trading at 0.7x TBV. Potential acquisitions by larger banks could unlock value. Playing this with: Long USB and TFC (strong balance sheets), short SBNY and PACW (CRE exposure). Rate cuts actually help net interest income for banks - flattening curve is positive.',+ category: 'BANKING',+ tags: ['JPM', 'BANKS', 'EARNINGS', 'FINANCIALS'],+ views: 3642,+ replies: 78,+ likes: 156,+ sentiment: 'NEUTRAL',+ priority: 'NORMAL',+ verified: true+ },+ {+ id: '6',+ time: '16:35:01',+ author: 'GlobalMacro_Trader',+ title: 'China $2.8T Infrastructure Plan - Supply Chain and Commodity Implications',+ content: 'China announced massive Belt & Road 2.0 initiative. This is bigger than most realize. $2.8T over 5 years = $560B annually (compare to China\'s 2023 GDP of $18T, this is 3% of GDP). Focus areas: AI infrastructure, renewable energy (solar/wind), digital connectivity, ports/logistics. Commodity implications: Steel demand up (already seeing Chinese rebar futures +8%), Copper demand massive (EV charging, grid infrastructure), Rare earths (tech components), Lithium (battery supply chain). Equity plays: Chinese infrastructure stocks (obviously), but ALSO emerging market infrastructure plays (Indonesia, Vietnam, Pakistan). Commodity plays: FCX (copper), ALB (lithium), MP (rare earths). Currency implications: Yuan strength short-term as capital flows in, but medium-term weakness as China exports inflation via commodity demand. This is 2008-2010 China stimulus playbook 2.0. Worked then, could work again.',+ category: 'GLOBAL',+ tags: ['CHINA', 'INFRASTRUCTURE', 'COMMODITIES', 'EM'],+ views: 3198,+ replies: 54,+ likes: 134,+ sentiment: 'BULLISH',+ priority: 'NORMAL',+ verified: false+ },+ {+ id: '7',+ time: '16:32:18',+ author: 'OptionsFlow_Alert',+ title: 'Massive Call Sweeps in Tech Stocks - Someone Knows Something',+ content: 'Unusual options activity detected across multiple tech names. MSFT: 50,000 calls at $400 strike expiring March (premium paid: $45M). GOOGL: 30,000 calls at $150 strike Feb expiry ($22M premium). META: 25,000 calls at $380 strike March ($31M). These are NOT retail traders - this is institutional flow, paying up for upside. Timing suspicious: 2 days before big tech earnings start. Either hedge funds positioning for earnings beats, or insiders know something about AI monetization that market doesn\'t. Historical precedent: Similar unusual activity preceded NVDA\'s 60% rally last year. My interpretation: Smart money is betting on AI revenue acceleration across cloud/advertising. Playing this with: Long dated calls on QQQ and XLK, selling near-term puts to finance. Risk/reward heavily skewed to upside if thesis correct. Monitoring daily options flow for any reversals.',+ category: 'OPTIONS',+ tags: ['OPTIONS', 'TECH', 'FLOW', 'UNUSUAL_ACTIVITY'],+ views: 7234,+ replies: 134,+ likes: 423,+ sentiment: 'BULLISH',+ priority: 'HOT',+ verified: true+ },+ {+ id: '8',+ time: '16:28:45',+ author: 'MacroHedgeFund',+ title: 'Yield Curve Un-Inversion - Historical Recession Indicator Analysis',+ content: 'The 2-10 year Treasury yield curve just un-inverted after 18 months inverted. Historical data: Every recession since 1970 was preceded by curve inversion FOLLOWED by un-inversion. Average lag between un-inversion and recession: 6-12 months. Current situation: Curve un-inverting due to Fed rate cuts (short end falling faster than long end). Question is whether this is "soft landing" scenario or delayed recession. Bull case: Inflation under control, employment strong, consumer spending resilient, corporate earnings growing. Bear case: Leading indicators weak (PMI, LEI, yield curve), commercial real estate stress, consumer credit deteriorating, geopolitical risks. My positioning: Cautiously bullish equities but hedged with TLT (long duration treasuries rally in recession), Gold (safe haven), defensive sectors (utilities, consumer staples). Time horizon matters - 6 month view bullish, 12-18 month view increasingly cautious.',+ category: 'MACRO',+ tags: ['BONDS', 'RECESSION', 'YIELD_CURVE', 'MACRO'],+ views: 4523,+ replies: 89,+ likes: 267,+ sentiment: 'NEUTRAL',+ priority: 'TRENDING',+ verified: true}-- setCreatePostLoading(true);- setError('');-- try {- const result = await ForumApiService.createPost({- title: newPostTitle,- content: newPostContent,- category_id: parseInt(newPostCategory)- }, apiKey!, deviceId);-- if (result.success && result.data?.success) {- setShowCreatePost(false);- setNewPostTitle('');- setNewPostContent('');- setNewPostCategory('');- // Refresh posts- loadPosts(selectedCategory, currentCategoryName);- } else {- throw new Error(result.error || 'Failed to create post');- }- } catch (err) {- setError('Failed to create post. Please try again.');- console.error('Post creation failed:', err);- } finally {- setCreatePostLoading(false);+ ];++ const topContributors: ForumUser[] = [+ { username: 'QuantTrader_Pro', reputation: 8947, posts: 1234, joined: '2021-03-15', status: 'ONLINE' },+ { username: 'CryptoWhale_2024', reputation: 7823, posts: 892, joined: '2020-11-22', status: 'ONLINE' },+ { username: 'OptionsFlow_Alert', reputation: 7456, posts: 1567, joined: '2022-01-08', status: 'ONLINE' },+ { username: 'MacroHedgeFund', reputation: 6789, posts: 743, joined: '2021-07-19', status: 'OFFLINE' },+ { username: 'TechInvestor88', reputation: 6234, posts: 654, joined: '2022-05-12', status: 'ONLINE' },+ { username: 'EnergyAnalyst_TX', reputation: 5892, posts: 521, joined: '2021-09-30', status: 'ONLINE' }+ ];++ const categories = [+ { name: 'ALL', count: 8947, color: BLOOMBERG_WHITE },+ { name: 'MARKETS', count: 2341, color: BLOOMBERG_BLUE },+ { name: 'TECH', count: 1876, color: BLOOMBERG_PURPLE },+ { name: 'CRYPTO', count: 1654, color: BLOOMBERG_CYAN },+ { name: 'OPTIONS', count: 1234, color: BLOOMBERG_YELLOW },+ { name: 'BANKING', count: 987, color: BLOOMBERG_GREEN },+ { name: 'ENERGY', count: 876, color: BLOOMBERG_ORANGE },+ { name: 'MACRO', count: 654, color: BLOOMBERG_RED },+ { name: 'GLOBAL', count: 543, color: BLOOMBERG_PURPLE }+ ];++ const getPriorityColor = (priority: string) => {+ switch (priority) {+ case 'HOT': return BLOOMBERG_RED;+ case 'TRENDING': return BLOOMBERG_ORANGE;+ case 'NORMAL': return BLOOMBERG_GRAY;+ default: return BLOOMBERG_GRAY;}};- const viewPostDetails = async (post: ForumPost) => {- setSelectedPost(post);- setShowPostDetails(true);-- try {- const result = await ForumApiService.getPostDetails(- post.post_uuid,- apiKey,- deviceId- );-- if (result.success && result.data?.success) {- setPostComments(result.data.data.comments || []);- }- } catch (err) {- console.error('Failed to load post details:', err);+ const getSentimentColor = (sentiment: string) => {+ switch (sentiment) {+ case 'BULLISH': return BLOOMBERG_GREEN;+ case 'BEARISH': return BLOOMBERG_RED;+ case 'NEUTRAL': return BLOOMBERG_YELLOW;+ default: return BLOOMBERG_GRAY;}};- const addComment = async () => {- if (!isAuthenticated || !selectedPost) return;-- const validation = ForumUtils.validateComment(newComment);- if (!validation.valid) {- setError(validation.error!);- return;- }-- setCommentLoading(true);-- try {- const result = await ForumApiService.addComment(- selectedPost.post_uuid,- { content: newComment },- apiKey!,- deviceId- );-- if (result.success && result.data?.success) {- setNewComment('');- // Reload post details- viewPostDetails(selectedPost);- } else {- throw new Error(result.error || 'Failed to add comment');- }- } catch (err) {- setError('Failed to add comment. Please try again.');- console.error('Comment failed:', err);- } finally {- setCommentLoading(false);- }- };-- // Render authentication error- if (!session || (!isAuthenticated && session.user_type !== 'guest')) {- return (- <div className="h-full bg-black text-white p-8 flex items-center justify-center">- <Card className="bg-zinc-900 border-zinc-700 max-w-md">- <CardHeader>- <CardTitle className="text-yellow-500 flex items-center gap-2">- <HelpCircle className="h-5 w-5" />- Authentication Required- </CardTitle>- </CardHeader>- <CardContent className="space-y-4">- <p className="text-zinc-300">- Please authenticate to access the Global Forum- </p>- <ul className="text-zinc-400 text-sm space-y-1">- <li>• Access to all forum categories</li>- <li>• Create posts and comments</li>- <li>• Vote on posts and comments</li>- <li>• Real-time forum activity</li>- <li>• User profiles and reputation</li>- </ul>- </CardContent>- </Card>- </div>- );- }+ const filteredPosts = activeCategory === 'ALL'+ ? forumPosts+ : forumPosts.filter(post => post.category === activeCategory);return (- <div className="h-full bg-black text-white font-mono">+ <div style={{+ height: '100%',+ backgroundColor: BLOOMBERG_DARK_BG,+ color: BLOOMBERG_WHITE,+ fontFamily: 'Consolas, monospace',+ overflow: 'hidden',+ display: 'flex',+ flexDirection: 'column',+ fontSize: '12px'+ }}>{/* Header */}- <div className="bg-zinc-900 border-b border-zinc-700 p-4">- <div className="flex items-center justify-between mb-4">- <div className="flex items-center gap-4">- <span style={{ color: colors.orange }} className="text-lg font-bold">FINCEPT</span>- <span className="text-white">GLOBAL FORUM</span>- <span className="text-zinc-500">|</span>-- {/* Search */}- <div className="flex items-center gap-2">- <Input- placeholder="Search posts, topics..."- value={searchQuery}- onChange={(e) => setSearchQuery(e.target.value)}- onKeyPress={(e) => e.key === 'Enter' && handleSearch()}- className="bg-zinc-800 border-zinc-600 text-white w-64"- />- <Button- onClick={handleSearch}- className="bg-zinc-700 hover:bg-zinc-600"- >- <Search className="h-4 w-4" />- </Button>- </div>+ <div style={{+ backgroundColor: BLOOMBERG_PANEL_BG,+ borderBottom: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '4px 8px',+ flexShrink: 0+ }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px', fontSize: '13px', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_ORANGE, fontWeight: 'bold' }}>FINCEPT GLOBAL FORUM</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_GREEN }}>● LIVE</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_YELLOW }}>USERS ONLINE: {onlineUsers.toLocaleString()}</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_CYAN }}>POSTS TODAY: 2,847</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_WHITE }}>{currentTime.toISOString().replace('T', ' ').substring(0, 19)} UTC</span>+ </div>- <span className="text-zinc-500">|</span>-- {/* User Status */}- <div className="flex items-center gap-2">- <User className="h-4 w-4" />- {session.user_type === 'registered' ? (- <span style={{ color: colors.green }}>- USER: {session.user_info?.username?.toUpperCase() || 'REGISTERED'}- </span>- ) : (- <span style={{ color: colors.yellow }}>USER: GUEST</span>- )}- </div>- </div>+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px', fontSize: '11px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>TRENDING:</span>+ <span style={{ color: BLOOMBERG_RED }}>FED_RATES</span>+ <span style={{ color: BLOOMBERG_CYAN }}>BTC_ETF</span>+ <span style={{ color: BLOOMBERG_PURPLE }}>NVDA_EARNINGS</span>+ <span style={{ color: BLOOMBERG_ORANGE }}>OIL_SUPPLY</span>+ <span style={{ color: BLOOMBERG_GREEN }}>AI_REVENUE</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_GRAY }}>SENTIMENT:</span>+ <span style={{ color: BLOOMBERG_GREEN }}>BULLISH 68%</span>+ <span style={{ color: BLOOMBERG_RED }}>BEARISH 18%</span>+ <span style={{ color: BLOOMBERG_YELLOW }}>NEUTRAL 14%</span></div>+ </div>- {/* Function Keys */}- <div className="flex items-center gap-4">- <Button- onClick={loadInitialData}- className="bg-transparent hover:bg-zinc-700 text-yellow-500 text-xs h-6 px-2"- >- F1:HELP- </Button>- <Button- onClick={loadInitialData}- className="bg-transparent hover:bg-zinc-700 text-yellow-500 text-xs h-6 px-2"- >- <RefreshCw className="h-3 w-3 mr-1" />- F2:REFRESH- </Button>- {isAuthenticated && (- <Button- onClick={() => setShowCreatePost(true)}- className="bg-transparent hover:bg-zinc-700 text-yellow-500 text-xs h-6 px-2"- >- <Plus className="h-3 w-3 mr-1" />- F3:NEW POST- </Button>- )}- <Button- onClick={() => document.querySelector('input')?.focus()}- className="bg-transparent hover:bg-zinc-700 text-yellow-500 text-xs h-6 px-2"- >- F4:SEARCH- </Button>- <Button- onClick={() => setSortBy('popular')}- className="bg-transparent hover:bg-zinc-700 text-yellow-500 text-xs h-6 px-2"- >- <TrendingUp className="h-3 w-3 mr-1" />- F5:TRENDING- </Button>+ {/* Function Keys */}+ <div style={{+ backgroundColor: BLOOMBERG_PANEL_BG,+ borderBottom: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '2px 4px',+ flexShrink: 0+ }}>+ <div style={{ display: 'grid', gridTemplateColumns: 'repeat(12, 1fr)', gap: '2px' }}>+ {[+ { key: "F1", label: "ALL", filter: "ALL" },+ { key: "F2", label: "MARKETS", filter: "MARKETS" },+ { key: "F3", label: "TECH", filter: "TECH" },+ { key: "F4", label: "CRYPTO", filter: "CRYPTO" },+ { key: "F5", label: "OPTIONS", filter: "OPTIONS" },+ { key: "F6", label: "BANKING", filter: "BANKING" },+ { key: "F7", label: "ENERGY", filter: "ENERGY" },+ { key: "F8", label: "MACRO", filter: "MACRO" },+ { key: "F9", label: "POST", filter: "POST" },+ { key: "F10", label: "SEARCH", filter: "SEARCH" },+ { key: "F11", label: "PROFILE", filter: "PROFILE" },+ { key: "F12", label: "SETTINGS", filter: "SETTINGS" }+ ].map(item => (+ <button key={item.key}+ onClick={() => item.filter !== 'POST' && item.filter !== 'SEARCH' && item.filter !== 'PROFILE' && item.filter !== 'SETTINGS' && setActiveCategory(item.filter)}+ style={{+ backgroundColor: activeCategory === item.filter ? BLOOMBERG_ORANGE : BLOOMBERG_DARK_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ color: activeCategory === item.filter ? BLOOMBERG_DARK_BG : BLOOMBERG_WHITE,+ padding: '2px 4px',+ fontSize: '9px',+ height: '16px',+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'center',+ fontWeight: activeCategory === item.filter ? 'bold' : 'normal',+ cursor: 'pointer'+ }}>+ <span style={{ color: BLOOMBERG_YELLOW }}>{item.key}:</span>+ <span style={{ marginLeft: '2px' }}>{item.label}</span>+ </button>+ ))}</div></div>{/* Main Content */}- <div className="flex h-[calc(100%-120px)]">- {/* Left Panel - Categories */}- <div className="w-80 bg-zinc-950 border-r border-zinc-700 p-4 overflow-y-auto">- <div style={{ color: colors.orange }} className="font-bold mb-4">FORUM CATEGORIES</div>-- <div className="space-y-2 mb-4">- <Button- onClick={() => loadAllPosts()}- variant={selectedCategory === null ? "default" : "ghost"}- className="w-full justify-start text-xs h-8"- >- ALL- </Button>- <Button- onClick={() => setSortBy('popular')}- variant="ghost"- className="w-full justify-start text-xs h-8"- >- TRENDING- </Button>- <Button- onClick={() => setSortBy('latest')}- variant="ghost"- className="w-full justify-start text-xs h-8"- >- RECENT- </Button>- </div>-- <Separator className="bg-zinc-700 mb-4" />-- {/* Categories List */}- <div className="space-y-2 mb-6">- {categories.map((category) => (- <Button- key={category.id}- onClick={() => loadPosts(category.id, category.name)}- variant={selectedCategory === category.id ? "default" : "ghost"}- className="w-full justify-start text-xs h-auto p-2 flex-col items-start"- >- <div className="flex justify-between w-full">- <span>{category.name}</span>- <Badge variant="secondary" className="text-xs">- {category.post_count}- </Badge>- </div>- {category.description && (- <span className="text-zinc-500 text-xs mt-1">- {ForumUtils.truncateText(category.description, 40)}- </span>- )}- </Button>+ <div style={{ flex: 1, overflow: 'auto', padding: '4px', backgroundColor: '#050505' }}>+ <div style={{ display: 'flex', gap: '4px', height: '100%' }}>++ {/* Left Panel - Categories & Stats */}+ <div style={{+ width: '280px',+ backgroundColor: BLOOMBERG_PANEL_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '4px',+ overflow: 'auto'+ }}>+ <div style={{ color: BLOOMBERG_ORANGE, fontSize: '11px', fontWeight: 'bold', marginBottom: '4px' }}>+ FORUM CATEGORIES+ </div>+ <div style={{ borderBottom: `1px solid ${BLOOMBERG_GRAY}`, marginBottom: '4px' }}></div>++ {categories.map((cat, index) => (+ <button key={index}+ onClick={() => setActiveCategory(cat.name)}+ style={{+ width: '100%',+ display: 'flex',+ justifyContent: 'space-between',+ padding: '4px',+ marginBottom: '2px',+ backgroundColor: activeCategory === cat.name ? 'rgba(255,165,0,0.1)' : 'transparent',+ border: `1px solid ${activeCategory === cat.name ? BLOOMBERG_ORANGE : 'transparent'}`,+ color: cat.color,+ fontSize: '10px',+ cursor: 'pointer',+ textAlign: 'left'+ }}>+ <span>{cat.name}</span>+ <span style={{ color: BLOOMBERG_CYAN }}>{cat.count}</span>+ </button>))}- </div>-- <Separator className="bg-zinc-700 mb-4" />- {/* Statistics */}- {stats && (- <div>- <div style={{ color: colors.yellow }} className="font-bold mb-2">FORUM STATISTICS</div>- <div className="text-xs space-y-1">- <div>Categories: {stats.total_categories}</div>- <div>Total Posts: {ForumUtils.formatNumber(stats.total_posts)}</div>- <div>Total Comments: {ForumUtils.formatNumber(stats.total_comments)}</div>- <div style={{ color: colors.green }}>Total Votes: {ForumUtils.formatNumber(stats.total_votes)}</div>+ <div style={{ borderTop: `1px solid ${BLOOMBERG_GRAY}`, marginTop: '8px', paddingTop: '8px' }}>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '10px', fontWeight: 'bold', marginBottom: '4px' }}>+ TOP CONTRIBUTORS</div>+ {topContributors.map((user, index) => (+ <div key={index} style={{+ padding: '3px',+ marginBottom: '2px',+ backgroundColor: 'rgba(255,255,255,0.02)',+ fontSize: '9px'+ }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '1px' }}>+ <span style={{ color: BLOOMBERG_WHITE }}>{user.username}</span>+ <span style={{ color: user.status === 'ONLINE' ? BLOOMBERG_GREEN : BLOOMBERG_GRAY }}>+ ●+ </span>+ </div>+ <div style={{ display: 'flex', gap: '6px', color: BLOOMBERG_GRAY }}>+ <span>REP: {user.reputation}</span>+ <span>POSTS: {user.posts}</span>+ </div>+ </div>+ ))}</div>- )}- </div>- {/* Center Panel - Posts */}- <div className="flex-1 bg-black overflow-y-auto">- <div className="p-4">- <div className="flex items-center justify-between mb-4">- <div className="flex items-center gap-4">- <span style={{ color: colors.orange }} className="font-bold">FORUM POSTS</span>- <span className="text-zinc-500">|</span>- <span className="text-white">{currentCategoryName}</span>+ <div style={{ borderTop: `1px solid ${BLOOMBERG_GRAY}`, marginTop: '8px', paddingTop: '8px' }}>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '10px', fontWeight: 'bold', marginBottom: '4px' }}>+ FORUM STATISTICS</div>-- <div className="flex items-center gap-2">- <Label className="text-zinc-400 text-xs">SORT:</Label>- <Select value={sortBy} onValueChange={setSortBy}>- <SelectTrigger className="w-32 bg-zinc-800 border-zinc-600 text-white text-xs h-8">- <SelectValue />- </SelectTrigger>- <SelectContent className="bg-zinc-800 border-zinc-600">- <SelectItem value="latest">Latest</SelectItem>- <SelectItem value="popular">Popular</SelectItem>- <SelectItem value="views">Most Viewed</SelectItem>- <SelectItem value="replies">Most Replies</SelectItem>- </SelectContent>- </Select>+ <div style={{ fontSize: '9px', lineHeight: '1.4', color: BLOOMBERG_GRAY }}>+ <div>Total Posts: 894,234</div>+ <div>Total Users: 47,832</div>+ <div>Posts Today: 2,847</div>+ <div>Active Now: {onlineUsers}</div>+ <div style={{ color: BLOOMBERG_GREEN }}>Avg Response: 12 min</div></div></div>+ </div>- {loading && (- <div className="text-yellow-500 mb-4">Loading posts...</div>- )}-- {error && (- <div className="text-red-400 bg-red-900/20 border border-red-900/50 rounded p-2 mb-4 text-xs">- {error}+ {/* Center Panel - Forum Posts */}+ <div style={{+ flex: 1,+ backgroundColor: BLOOMBERG_PANEL_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '4px',+ overflow: 'auto'+ }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '4px' }}>+ <div style={{ color: BLOOMBERG_ORANGE, fontSize: '11px', fontWeight: 'bold' }}>+ FORUM POSTS [{activeCategory}]</div>- )}-- {/* Posts List */}- <div className="space-y-4">- {posts.map((post) => (- <Card key={post.post_uuid} className="bg-zinc-900 border-zinc-700">- <CardContent className="p-4">- <div className="flex items-start justify-between mb-2">- <div className="flex items-center gap-2">- {post.is_pinned && <Pin className="h-4 w-4" style={{ color: colors.orange }} />}- <Button- onClick={() => viewPostDetails(post)}- variant="ghost"- className="p-0 h-auto text-left text-white hover:text-blue-400"- >- <span className="text-sm font-medium">- {ForumUtils.truncateText(post.title, 60)}- </span>- </Button>- <Badge- variant="outline"- className="text-xs"- style={{ borderColor: colors.blue, color: colors.blue }}- >- {post.category_name}- </Badge>- </div>- </div>+ <div style={{ display: 'flex', gap: '4px', fontSize: '9px' }}>+ <button onClick={() => setSortBy('LATEST')} style={{+ padding: '2px 6px',+ backgroundColor: sortBy === 'LATEST' ? BLOOMBERG_ORANGE : BLOOMBERG_DARK_BG,+ color: sortBy === 'LATEST' ? BLOOMBERG_DARK_BG : BLOOMBERG_WHITE,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ cursor: 'pointer'+ }}>LATEST</button>+ <button onClick={() => setSortBy('HOT')} style={{+ padding: '2px 6px',+ backgroundColor: sortBy === 'HOT' ? BLOOMBERG_ORANGE : BLOOMBERG_DARK_BG,+ color: sortBy === 'HOT' ? BLOOMBERG_DARK_BG : BLOOMBERG_WHITE,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ cursor: 'pointer'+ }}>HOT</button>+ <button onClick={() => setSortBy('TOP')} style={{+ padding: '2px 6px',+ backgroundColor: sortBy === 'TOP' ? BLOOMBERG_ORANGE : BLOOMBERG_DARK_BG,+ color: sortBy === 'TOP' ? BLOOMBERG_DARK_BG : BLOOMBERG_WHITE,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ cursor: 'pointer'+ }}>TOP</button>+ </div>+ </div>+ <div style={{ borderBottom: `1px solid ${BLOOMBERG_GRAY}`, marginBottom: '8px' }}></div>++ {filteredPosts.map((post, index) => (+ <div key={post.id} style={{+ marginBottom: '6px',+ padding: '6px',+ backgroundColor: index % 2 === 0 ? 'rgba(255,255,255,0.02)' : 'transparent',+ borderLeft: `3px solid ${getPriorityColor(post.priority)}`,+ paddingLeft: '6px'+ }}>+ <div style={{ display: 'flex', gap: '4px', alignItems: 'center', marginBottom: '2px', fontSize: '8px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>{post.time}</span>+ <span style={{ color: getPriorityColor(post.priority), fontWeight: 'bold' }}>[{post.priority}]</span>+ <span style={{ color: BLOOMBERG_BLUE }}>[{post.category}]</span>+ <span style={{ color: getSentimentColor(post.sentiment) }}>{post.sentiment}</span>+ {post.verified && <span style={{ color: BLOOMBERG_CYAN }}>✓ VERIFIED</span>}+ </div>- <div className="flex items-center gap-4 text-xs text-zinc-400 mb-2">- <div className="flex items-center gap-1">- <Eye className="h-3 w-3" />- {ForumUtils.formatNumber(post.views)}- </div>- <div- className={`flex items-center gap-1 ${ForumUtils.getVoteColor(ForumUtils.calculateVoteScore(post.likes, post.dislikes))}`}- >- <ThumbsUp className="h-3 w-3" />- {ForumUtils.calculateVoteScore(post.likes, post.dislikes)}- </div>- <div className="flex items-center gap-1">- <MessageSquare className="h-3 w-3" />- {post.reply_count}- </div>- <div>By: {post.author_display_name}</div>- <div>{ForumUtils.formatTimestamp(post.created_at)}</div>- </div>+ <div style={{ display: 'flex', gap: '4px', alignItems: 'center', marginBottom: '2px', fontSize: '9px' }}>+ <span style={{ color: BLOOMBERG_CYAN }}>@{post.author}</span>+ <span style={{ color: BLOOMBERG_GRAY }}>•</span>+ <span style={{ color: BLOOMBERG_WHITE, fontWeight: 'bold' }}>{post.title}</span>+ </div>- <p className="text-zinc-300 text-xs mb-3">- {ForumUtils.truncateText(post.content, 120)}- </p>+ <div style={{ color: BLOOMBERG_GRAY, fontSize: '9px', lineHeight: '1.3', marginBottom: '3px' }}>+ {post.content}+ </div>- <div className="flex items-center gap-2">- <Button- onClick={() => viewPostDetails(post)}- size="sm"- className="bg-zinc-700 hover:bg-zinc-600 text-xs h-6"- >- VIEW- </Button>-- {isAuthenticated && (- <>- <Button- onClick={() => handleVote(post.post_uuid, 'up')}- size="sm"- className="bg-transparent hover:bg-green-900/20 text-green-400 border border-green-600 text-xs h-6"- >- 👍 UP- </Button>- <Button- onClick={() => handleVote(post.post_uuid, 'down')}- size="sm"- className="bg-transparent hover:bg-red-900/20 text-red-400 border border-red-600 text-xs h-6"- >- 👎 DOWN- </Button>- </>- )}- </div>- </CardContent>- </Card>- ))}- </div>+ <div style={{ display: 'flex', gap: '6px', fontSize: '8px', marginBottom: '2px' }}>+ {post.tags.map((tag, i) => (+ <span key={i} style={{+ color: BLOOMBERG_YELLOW,+ backgroundColor: 'rgba(255,255,0,0.1)',+ padding: '1px 4px',+ borderRadius: '2px'+ }}>#{tag}</span>+ ))}+ </div>- {posts.length === 0 && !loading && (- <div className="text-center text-zinc-400 mt-8">- <MessageSquare className="h-12 w-12 mx-auto mb-4 opacity-50" />- <p>No posts found</p>+ <div style={{ display: 'flex', gap: '10px', fontSize: '8px' }}>+ <span style={{ color: BLOOMBERG_CYAN }}>👁️ {post.views.toLocaleString()}</span>+ <span style={{ color: BLOOMBERG_PURPLE }}>💬 {post.replies}</span>+ <span style={{ color: BLOOMBERG_GREEN }}>👍 {post.likes}</span>+ <button style={{+ color: BLOOMBERG_ORANGE,+ backgroundColor: 'transparent',+ border: 'none',+ cursor: 'pointer',+ fontSize: '8px'+ }}>REPLY</button>+ <button style={{+ color: BLOOMBERG_BLUE,+ backgroundColor: 'transparent',+ border: 'none',+ cursor: 'pointer',+ fontSize: '8px'+ }}>SHARE</button>+ </div></div>- )}+ ))}</div>- </div>- {/* Right Panel - User Dashboard */}- <div className="w-80 bg-zinc-950 border-l border-zinc-700 p-4 overflow-y-auto">- <div style={{ color: colors.orange }} className="font-bold mb-4">USER DASHBOARD</div>-- {/* User Info */}- <div className="mb-6">- <div style={{ color: colors.yellow }} className="font-bold mb-2">CURRENT USER</div>- <div className="flex items-center gap-3 mb-2">- <div- className="w-8 h-8 rounded flex items-center justify-center text-xs font-bold text-white"- style={{ backgroundColor: session.user_type === 'registered' ? colors.green : colors.yellow }}- >- {session.user_type === 'registered'- ? session.user_info?.username?.substring(0, 2).toUpperCase() || 'RU'- : 'GU'- }- </div>- <div>- <div className="text-white text-sm">- {session.user_type === 'registered'- ? session.user_info?.username || 'Registered User'- : 'Guest User'- }+ {/* Right Panel - Activity & Trending */}+ <div style={{+ width: '280px',+ backgroundColor: BLOOMBERG_PANEL_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '4px',+ overflow: 'auto'+ }}>+ <div style={{ color: BLOOMBERG_ORANGE, fontSize: '11px', fontWeight: 'bold', marginBottom: '4px' }}>+ TRENDING TOPICS (1H)+ </div>+ <div style={{ borderBottom: `1px solid ${BLOOMBERG_GRAY}`, marginBottom: '8px' }}></div>++ {[+ { topic: '#FED_RATES', mentions: 847, sentiment: 'BULLISH', change: '+234%' },+ { topic: '#BTC_ETF', mentions: 723, sentiment: 'BULLISH', change: '+189%' },+ { topic: '#NVDA', mentions: 612, sentiment: 'BULLISH', change: '+156%' },+ { topic: '#OIL_SUPPLY', mentions: 487, sentiment: 'BULLISH', change: '+123%' },+ { topic: '#BANKING_CRISIS', mentions: 356, sentiment: 'BEARISH', change: '+89%' },+ { topic: '#AI_REVENUE', mentions: 298, sentiment: 'BULLISH', change: '+67%' }+ ].map((item, index) => (+ <div key={index} style={{+ padding: '3px',+ marginBottom: '3px',+ backgroundColor: 'rgba(255,255,255,0.02)',+ fontSize: '9px'+ }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '1px' }}>+ <span style={{ color: BLOOMBERG_YELLOW }}>{item.topic}</span>+ <span style={{ color: BLOOMBERG_GREEN }}>{item.change}</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between', color: BLOOMBERG_GRAY }}>+ <span>{item.mentions} mentions</span>+ <span style={{ color: getSentimentColor(item.sentiment) }}>{item.sentiment}</span></div>- {session.user_type === 'registered' ? (- <div style={{ color: colors.green }} className="text-xs">- Credits: {session.user_info?.credit_balance || 0}- </div>- ) : (- <div style={{ color: colors.yellow }} className="text-xs">- Limited Access- </div>- )}</div>- </div>- </div>-- <Separator className="bg-zinc-700 mb-4" />+ ))}- {/* User Actions */}- <div className="mb-6">- <div style={{ color: colors.yellow }} className="font-bold mb-2">USER ACTIONS</div>- <div className="space-y-2">- {isAuthenticated ? (- <>- <Button- onClick={() => setShowCreatePost(true)}- className="w-full justify-start text-xs h-8"- >- CREATE NEW POST- </Button>- <Button className="w-full justify-start text-xs h-6">- MY POSTS- </Button>- <Button className="w-full justify-start text-xs h-6">- MY ACTIVITY- </Button>- <Button className="w-full justify-start text-xs h-6">- SETTINGS- </Button>- </>- ) : (- <>- <Button- onClick={() => loadAllPosts()}- className="w-full justify-start text-xs h-6"- >- VIEW POSTS- </Button>- <Button- onClick={() => document.querySelector('input')?.focus()}- className="w-full justify-start text-xs h-6"- >- SEARCH FORUM- </Button>- </>- )}+ <div style={{ borderTop: `1px solid ${BLOOMBERG_GRAY}`, marginTop: '12px', paddingTop: '8px' }}>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '10px', fontWeight: 'bold', marginBottom: '4px' }}>+ RECENT ACTIVITY+ </div>+ {[+ { user: 'QuantTrader_Pro', action: 'posted', target: 'Fed Rate Analysis', time: '2 min ago' },+ { user: 'CryptoWhale_2024', action: 'replied to', target: 'BTC ETF Thread', time: '5 min ago' },+ { user: 'OptionsFlow_Alert', action: 'liked', target: 'NVDA Earnings Post', time: '8 min ago' },+ { user: 'MacroHedgeFund', action: 'posted', target: 'Yield Curve Analysis', time: '12 min ago' },+ { user: 'TechInvestor88', action: 'replied to', target: 'AI Infrastructure', time: '15 min ago' }+ ].map((activity, index) => (+ <div key={index} style={{+ padding: '2px',+ marginBottom: '2px',+ fontSize: '8px',+ color: BLOOMBERG_GRAY,+ lineHeight: '1.3'+ }}>+ <span style={{ color: BLOOMBERG_CYAN }}>@{activity.user}</span>+ {' '}<span>{activity.action}</span>{' '}+ <span style={{ color: BLOOMBERG_WHITE }}>{activity.target}</span>+ {' '}<span style={{ color: BLOOMBERG_YELLOW }}>• {activity.time}</span>+ </div>+ ))}</div>- </div>- <Separator className="bg-zinc-700 mb-4" />-- {/* Recent Activity */}- <div>- <div style={{ color: colors.yellow }} className="font-bold mb-2">RECENT ACTIVITY</div>- <div className="text-xs text-zinc-400 space-y-1">- <div>Loading activity...</div>+ <div style={{ borderTop: `1px solid ${BLOOMBERG_GRAY}`, marginTop: '12px', paddingTop: '8px' }}>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '10px', fontWeight: 'bold', marginBottom: '4px' }}>+ SENTIMENT ANALYSIS+ </div>+ <div style={{ fontSize: '9px' }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '1px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Bullish Posts:</span>+ <span style={{ color: BLOOMBERG_GREEN }}>68%</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '1px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Bearish Posts:</span>+ <span style={{ color: BLOOMBERG_RED }}>18%</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '1px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Neutral Posts:</span>+ <span style={{ color: BLOOMBERG_YELLOW }}>14%</span>+ </div>+ <div style={{ borderTop: `1px solid ${BLOOMBERG_GRAY}`, marginTop: '4px', paddingTop: '4px' }}>+ <span style={{ color: BLOOMBERG_CYAN }}>Overall Sentiment:</span>+ <span style={{ color: BLOOMBERG_GREEN, fontWeight: 'bold', marginLeft: '4px' }}>+0.62 BULLISH</span>+ </div>+ </div></div></div></div></div>- {/* Create Post Dialog */}- <Dialog open={showCreatePost} onOpenChange={setShowCreatePost}>- <DialogContent className="bg-zinc-900 border-zinc-700 text-white">- <DialogHeader>- <DialogTitle style={{ color: colors.orange }}>CREATE NEW POST</DialogTitle>- </DialogHeader>- <div className="space-y-4">- <div>- <Label className="text-white">Category</Label>- <Select value={newPostCategory} onValueChange={setNewPostCategory}>- <SelectTrigger className="bg-zinc-800 border-zinc-600 text-white">- <SelectValue placeholder="Select category" />- </SelectTrigger>- <SelectContent className="bg-zinc-800 border-zinc-600">- {categories.map((category) => (- <SelectItem key={category.id} value={category.id.toString()}>- {category.name}- </SelectItem>- ))}- </SelectContent>- </Select>- </div>- <div>- <Label className="text-white">Title</Label>- <Input- value={newPostTitle}- onChange={(e) => setNewPostTitle(e.target.value)}- className="bg-zinc-800 border-zinc-600 text-white"- placeholder="Enter post title..."- />- </div>- <div>- <Label className="text-white">Content</Label>- <Textarea- value={newPostContent}- onChange={(e) => setNewPostContent(e.target.value)}- className="bg-zinc-800 border-zinc-600 text-white min-h-32"- placeholder="Enter post content..."- />- </div>- {error && (- <div className="text-red-400 text-xs">{error}</div>- )}- <div className="flex justify-end gap-2">- <Button- onClick={() => setShowCreatePost(false)}- variant="ghost"- className="text-zinc-400"- >- CANCEL- </Button>- <Button- onClick={handleCreatePost}- disabled={createPostLoading}- style={{ backgroundColor: colors.orange }}- className="hover:bg-orange-600"- >- {createPostLoading ? 'CREATING...' : 'CREATE POST'}- </Button>- </div>+ {/* Status Bar */}+ <div style={{+ borderTop: `1px solid ${BLOOMBERG_GRAY}`,+ backgroundColor: BLOOMBERG_PANEL_BG,+ padding: '2px 8px',+ fontSize: '10px',+ color: BLOOMBERG_GRAY,+ flexShrink: 0+ }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>+ <div style={{ display: 'flex', gap: '16px' }}>+ <span>Fincept Global Forum v2.4.1 | Professional trading community</span>+ <span>Posts: 894,234 | Users: 47,832 | Active: {onlineUsers}</span></div>- </DialogContent>- </Dialog>-- {/* Post Details Dialog */}- <Dialog open={showPostDetails} onOpenChange={setShowPostDetails}>- <DialogContent className="bg-zinc-900 border-zinc-700 text-white max-w-4xl max-h-[80vh] overflow-y-auto">- {selectedPost && (- <>- <DialogHeader>- <DialogTitle style={{ color: colors.orange }}>POST DETAILS</DialogTitle>- </DialogHeader>- <div className="space-y-4">- <div>- <h3 className="text-lg font-bold text-white mb-2">{selectedPost.title}</h3>- <div className="flex items-center gap-4 text-xs text-zinc-400 mb-4">- <div>Author: {selectedPost.author_display_name}</div>- <div>Category: {selectedPost.category_name}</div>- <div>Views: {ForumUtils.formatNumber(selectedPost.views)}</div>- <div>Likes: {selectedPost.likes}</div>- <div>Comments: {postComments.length}</div>- </div>- <div className="text-zinc-300 whitespace-pre-wrap mb-4">- {selectedPost.content}- </div>- </div>-- {/* Comments */}- <div>- <h4 className="font-bold text-yellow-500 mb-2">COMMENTS ({postComments.length})</h4>-- {/* Add Comment */}- {isAuthenticated && (- <div className="flex gap-2 mb-4">- <Textarea- value={newComment}- onChange={(e) => setNewComment(e.target.value)}- placeholder="Add a comment..."- className="bg-zinc-800 border-zinc-600 text-white flex-1 min-h-20"- />- <Button- onClick={addComment}- disabled={commentLoading}- style={{ backgroundColor: colors.orange }}- className="hover:bg-orange-600"- >- {commentLoading ? 'POSTING...' : 'POST'}- </Button>- </div>- )}-- {/* Comments List */}- <div className="space-y-3">- {postComments.map((comment) => (- <div key={comment.comment_uuid} className="bg-zinc-800 p-3 rounded border border-zinc-700">- <div className="flex items-center justify-between mb-2">- <div className="flex items-center gap-2">- <span className="text-white font-medium text-sm">- {comment.author_display_name}- </span>- <span className="text-zinc-500 text-xs">- {ForumUtils.formatTimestamp(comment.created_at)}- </span>- </div>- <div className="flex items-center gap-2">- <div- className={`text-xs ${ForumUtils.getVoteColor(ForumUtils.calculateVoteScore(comment.likes, comment.dislikes))}`}- >- {ForumUtils.calculateVoteScore(comment.likes, comment.dislikes)}- </div>- </div>- </div>- <div className="text-zinc-300 text-sm whitespace-pre-wrap">- {comment.content}- </div>- </div>- ))}-- {postComments.length === 0 && (- <div className="text-center text-zinc-500 py-8">- <MessageSquare className="h-8 w-8 mx-auto mb-2 opacity-50" />- <p className="text-sm">No comments yet</p>- </div>- )}- </div>- </div>-- <div className="flex justify-end">- <Button- onClick={() => setShowPostDetails(false)}- className="bg-zinc-700 hover:bg-zinc-600"- >- CLOSE- </Button>- </div>- </div>- </>- )}- </DialogContent>- </Dialog>+ <div style={{ display: 'flex', gap: '16px' }}>+ <span>Category: {activeCategory}</span>+ <span>Sort: {sortBy}</span>+ <span style={{ color: BLOOMBERG_GREEN }}>STATUS: LIVE</span>+ </div>+ </div>+ </div></div>);};diff --git a/fincept-terminal-desktop/src/components/tabs/MaritimeTab.tsx b/fincept-terminal-desktop/src/components/tabs/MaritimeTab.tsxnew file mode 100644index 000000000..2b9f813ed--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/MaritimeTab.tsx@@ -0,0 +1,569 @@+import React, { useState, useEffect, useRef } from 'react';++interface MarkerData {+ lat: number;+ lng: number;+ title: string;+ type: 'Ship' | 'Port' | 'Industry' | 'Bank' | 'Exchange';+}++interface TradeRoute {+ name: string;+ value: string;+ status: 'active' | 'delayed' | 'critical';+ vessels: number;+ coordinates: [number, number][];+}++interface IntelligenceData {+ timestamp: string;+ threat_level: 'low' | 'medium' | 'high' | 'critical';+ active_vessels: number;+ monitored_routes: number;+ trade_volume: string;+}++export default function MaritimeTab() {+ const [markers, setMarkers] = useState<MarkerData[]>([]);+ const [selectedRoute, setSelectedRoute] = useState<TradeRoute | null>(null);+ const [markerType, setMarkerType] = useState<MarkerData['type']>('Ship');+ const [showRoutes, setShowRoutes] = useState(true);+ const [showShips, setShowShips] = useState(true);+ const [intelligence, setIntelligence] = useState<IntelligenceData>({+ timestamp: new Date().toISOString(),+ threat_level: 'low',+ active_vessels: 1247,+ monitored_routes: 48,+ trade_volume: '$847.3B'+ });+ const mapRef = useRef<HTMLIFrameElement>(null);++ const tradeRoutes: TradeRoute[] = [+ { name: 'Mumbai → Rotterdam', value: '$45B', status: 'active', vessels: 23, coordinates: [[19.0760, 72.8777], [51.9244, 4.4777]] },+ { name: 'Mumbai → Shanghai', value: '$156B', status: 'active', vessels: 89, coordinates: [[19.0760, 72.8777], [31.2304, 121.4737]] },+ { name: 'Mumbai → Singapore', value: '$89B', status: 'active', vessels: 45, coordinates: [[19.0760, 72.8777], [1.3521, 103.8198]] },+ { name: 'Chennai → Tokyo', value: '$67B', status: 'delayed', vessels: 34, coordinates: [[13.0827, 80.2707], [35.6762, 139.6503]] },+ { name: 'Kolkata → Hong Kong', value: '$45B', status: 'active', vessels: 28, coordinates: [[22.5726, 88.3639], [22.3193, 114.1694]] },+ { name: 'Mumbai → Dubai', value: '$78B', status: 'critical', vessels: 12, coordinates: [[19.0760, 72.8777], [25.2048, 55.2708]] },+ { name: 'Mumbai → New York', value: '$123B', status: 'active', vessels: 56, coordinates: [[19.0760, 72.8777], [40.7128, -74.0060]] },+ { name: 'Chennai → Sydney', value: '$54B', status: 'active', vessels: 31, coordinates: [[13.0827, 80.2707], [-33.8688, 151.2093]] },+ { name: 'Cochin → Malacca', value: '$34B', status: 'active', vessels: 19, coordinates: [[9.9312, 76.2673], [1.3521, 103.8198]] },+ { name: 'Mumbai → Cape Town', value: '$28B', status: 'delayed', vessels: 8, coordinates: [[19.0760, 72.8777], [-33.9249, 18.4241]] }+ ];++ const addMarker = (title: string, lat: number, lng: number) => {+ const newMarker: MarkerData = { lat, lng, title, type: markerType };+ setMarkers([...markers, newMarker]);+ };++ const clearMarkers = () => {+ setMarkers([]);+ };++ const presetLocations = [+ { name: 'Mumbai Port', lat: 19.0760, lng: 72.8777, type: 'Port' as const },+ { name: 'Shanghai Port', lat: 31.2304, lng: 121.4737, type: 'Port' as const },+ { name: 'Singapore Port', lat: 1.3521, lng: 103.8198, type: 'Port' as const },+ { name: 'Hong Kong Port', lat: 22.3193, lng: 114.1694, type: 'Port' as const },+ ];++ const addPreset = (preset: typeof presetLocations[0]) => {+ setMarkers([...markers, preset]);+ };++ useEffect(() => {+ const interval = setInterval(() => {+ setIntelligence(prev => ({+ ...prev,+ timestamp: new Date().toISOString(),+ active_vessels: prev.active_vessels + Math.floor(Math.random() * 10 - 5)+ }));+ }, 5000);+ return () => clearInterval(interval);+ }, []);++ const mapHTML = `+<!DOCTYPE html>+<html>+<head>+ <meta charset="utf-8" />+ <link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />+ <style>+ body { margin: 0; padding: 0; background: #000; }+ #map { height: 100vh; width: 100vw; }+ .ocean-route { stroke: #00ffff; stroke-width: 2; stroke-opacity: 0.8; stroke-dasharray: 8,4; }+ .route-animation { animation: routeFlow 3s linear infinite; }+ @keyframes routeFlow { 0% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -24; } }+ .ship-marker { animation: shipBob 2s ease-in-out infinite; z-index: 1000 !important; }+ @keyframes shipBob { 0%, 100% { transform: translateY(0px); } 50% { transform: translateY(-3px); } }+ </style>+</head>+<body>+ <div id="map"></div>+ <script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>+ <script>+ var map = L.map('map', { zoomControl: true }).setView([20.0, 75.0], 4);++ L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {+ attribution: 'FINCEPT MARITIME INTELLIGENCE',+ maxZoom: 18+ }).addTo(map);++ var markers = [];+ var routesLayer = null;+ var shipsLayer = null;++ function createIcon(type, size = 24) {+ var icons = {+ 'Ship': { symbol: '🚢', color: '#1e90ff' },+ 'Port': { symbol: '⚓', color: '#ff8c00' },+ 'Industry': { symbol: '🏭', color: '#ff4500' },+ 'Bank': { symbol: '🏦', color: '#ffd700' },+ 'Exchange': { symbol: '💱', color: '#ff1493' }+ };+ var config = icons[type] || icons['Ship'];+ return L.divIcon({+ html: '<div style="width:' + size + 'px;height:' + size + 'px;border-radius:50%;background:#0a0a0a;border:3px solid ' + config.color + ';display:flex;align-items:center;justify-content:center;font-size:' + (size-8) + 'px;box-shadow:0 0 20px ' + config.color + ';">' + config.symbol + '</div>',+ iconSize: [size, size],+ iconAnchor: [size/2, size/2],+ className: type === 'Ship' ? 'ship-marker' : ''+ });+ }++ var oceanRoutes = [+ { name: "Mumbai-Rotterdam", coords: [[19.0760, 72.8777], [15.0, 60.0], [12.0, 45.0], [15.0, 35.0], [30.0, 32.0], [35.0, 25.0], [38.0, 15.0], [40.0, 5.0], [42.0, -5.0], [45.0, -15.0], [51.9244, 4.4777]], value: "45B USD" },+ { name: "Mumbai-Shanghai", coords: [[19.0760, 72.8777], [15.0, 68.0], [10.0, 75.0], [5.0, 85.0], [10.0, 95.0], [20.0, 110.0], [31.2304, 121.4737]], value: "156B USD" },+ { name: "Mumbai-Singapore", coords: [[19.0760, 72.8777], [15.0, 75.0], [10.0, 80.0], [5.0, 90.0], [1.3521, 103.8198]], value: "89B USD" },+ { name: "Chennai-Tokyo", coords: [[13.0827, 80.2707], [10.0, 90.0], [15.0, 105.0], [25.0, 125.0], [35.6762, 139.6503]], value: "67B USD" },+ { name: "Kolkata-Hong Kong", coords: [[22.5726, 88.3639], [18.0, 95.0], [15.0, 105.0], [22.3193, 114.1694]], value: "45B USD" },+ { name: "Mumbai-Dubai", coords: [[19.0760, 72.8777], [20.0, 65.0], [23.0, 58.0], [25.2048, 55.2708]], value: "78B USD" },+ { name: "Mumbai-New York", coords: [[19.0760, 72.8777], [15.0, 60.0], [10.0, 40.0], [5.0, 20.0], [0.0, 0.0], [10.0, -20.0], [25.0, -40.0], [35.0, -60.0], [40.7128, -74.0060]], value: "123B USD" },+ { name: "Chennai-Sydney", coords: [[13.0827, 80.2707], [5.0, 90.0], [-10.0, 105.0], [-25.0, 130.0], [-33.8688, 151.2093]], value: "54B USD" },+ { name: "Cochin-Malacca", coords: [[9.9312, 76.2673], [7.0, 79.0], [6.9271, 79.8612], [3.0, 95.0], [1.3521, 103.8198]], value: "34B USD" },+ { name: "Mumbai-Cape Town", coords: [[19.0760, 72.8777], [10.0, 60.0], [-5.0, 50.0], [-20.0, 35.0], [-33.9249, 18.4241]], value: "28B USD" }+ ];++ function createRoutes() {+ if (routesLayer) map.removeLayer(routesLayer);+ routesLayer = L.layerGroup();+ oceanRoutes.forEach(route => {+ var polyline = L.polyline(route.coords, {+ color: '#00ffff',+ weight: 2,+ opacity: 0.8,+ className: 'route-animation ocean-route'+ });+ polyline.bindPopup('<div style="background:#000;color:#0ff;padding:8px;border:1px solid #0ff;font-family:Consolas;font-size:10px;"><b>' + route.name + '</b><br/>Value: ' + route.value + '</div>');+ routesLayer.addLayer(polyline);+ });+ map.addLayer(routesLayer);+ }++ function createShips() {+ if (shipsLayer) map.removeLayer(shipsLayer);+ shipsLayer = L.layerGroup();+ oceanRoutes.forEach(route => {+ for (var i = 1; i < route.coords.length - 1; i += 2) {+ var ship = L.marker(route.coords[i], { icon: createIcon('Ship', 28) });+ ship.bindPopup('<div style="background:#000;color:#1e90ff;padding:8px;border:1px solid #1e90ff;font-family:Consolas;font-size:10px;"><b>🚢 VESSEL</b><br/>Route: ' + route.name.split('-')[0] + '<br/>Speed: ' + (Math.floor(Math.random()*10+15)) + ' knots</div>');+ shipsLayer.addLayer(ship);+ }+ });+ map.addLayer(shipsLayer);+ }++ window.addMarker = function(lat, lng, title, type) {+ var marker = L.marker([lat, lng], { icon: createIcon(type, 28) });+ marker.bindPopup('<div style="background:#000;color:#ff8c00;padding:8px;border:1px solid #ff8c00;font-family:Consolas;font-size:10px;"><b>' + title + '</b><br/>Type: ' + type + '<br/>Coords: ' + lat.toFixed(4) + ', ' + lng.toFixed(4) + '</div>');+ marker.addTo(map);+ markers.push(marker);+ };++ window.clearMarkers = function() {+ markers.forEach(m => map.removeLayer(m));+ markers = [];+ };++ window.toggleRoutes = function() {+ if (map.hasLayer(routesLayer)) map.removeLayer(routesLayer);+ else createRoutes();+ };++ window.toggleShips = function() {+ if (map.hasLayer(shipsLayer)) map.removeLayer(shipsLayer);+ else createShips();+ };++ createRoutes();+ createShips();+ </script>+</body>+</html>+ `;++ return (+ <div style={{ width: '100%', height: '100%', display: 'flex', flexDirection: 'column', backgroundColor: '#000' }}>+ <style>{`+ *::-webkit-scrollbar { width: 6px; height: 6px; }+ *::-webkit-scrollbar-track { background: #0a0a0a; }+ *::-webkit-scrollbar-thumb { background: #1a1a1a; border-radius: 3px; }+ *::-webkit-scrollbar-thumb:hover { background: #2a2a2a; }+ `}</style>++ {/* CIA-Style Header */}+ <div style={{+ borderBottom: '2px solid #00ff00',+ padding: '8px 16px',+ background: 'linear-gradient(180deg, #0a0a0a 0%, #000 100%)',+ display: 'flex',+ justifyContent: 'space-between',+ alignItems: 'center',+ flexShrink: 0+ }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '16px' }}>+ <span style={{ color: '#00ff00', fontSize: '14px', fontWeight: 'bold', letterSpacing: '2px' }}>+ ⚓ FINCEPT MARITIME INTELLIGENCE+ </span>+ <div style={{ width: '1px', height: '16px', background: '#00ff00' }} />+ <span style={{ color: '#0ff', fontSize: '10px' }}>CLASSIFIED // TRADE ROUTE ANALYSIS</span>+ </div>+ <div style={{ display: 'flex', alignItems: 'center', gap: '16px' }}>+ <span style={{ color: intelligence.threat_level === 'critical' ? '#ff0000' : intelligence.threat_level === 'high' ? '#ff8c00' : intelligence.threat_level === 'medium' ? '#ffd700' : '#00ff00', fontSize: '10px', fontWeight: 'bold' }}>+ THREAT: {intelligence.threat_level.toUpperCase()}+ </span>+ <span style={{ color: '#888', fontSize: '9px' }}>{new Date(intelligence.timestamp).toLocaleString()}</span>+ </div>+ </div>++ {/* Main Layout */}+ <div style={{ flex: 1, display: 'flex', minHeight: 0, overflow: 'hidden' }}>++ {/* Left Sidebar - Intelligence Panel */}+ <div style={{ width: '280px', borderRight: '1px solid #1a1a1a', display: 'flex', flexDirection: 'column', background: '#000', flexShrink: 0 }}>++ {/* Intelligence Stats */}+ <div style={{ padding: '12px', borderBottom: '1px solid #1a1a1a' }}>+ <div style={{ color: '#00ff00', fontSize: '10px', fontWeight: 'bold', marginBottom: '8px', letterSpacing: '1px' }}>GLOBAL INTEL</div>+ <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '8px' }}>+ <div style={{ background: '#0a0a0a', border: '1px solid #1a1a1a', padding: '8px' }}>+ <div style={{ color: '#888', fontSize: '8px' }}>ACTIVE VESSELS</div>+ <div style={{ color: '#0ff', fontSize: '16px', fontWeight: 'bold' }}>{intelligence.active_vessels}</div>+ </div>+ <div style={{ background: '#0a0a0a', border: '1px solid #1a1a1a', padding: '8px' }}>+ <div style={{ color: '#888', fontSize: '8px' }}>ROUTES</div>+ <div style={{ color: '#0ff', fontSize: '16px', fontWeight: 'bold' }}>{intelligence.monitored_routes}</div>+ </div>+ <div style={{ background: '#0a0a0a', border: '1px solid #1a1a1a', padding: '8px', gridColumn: 'span 2' }}>+ <div style={{ color: '#888', fontSize: '8px' }}>TRADE VOLUME (24H)</div>+ <div style={{ color: '#00ff00', fontSize: '16px', fontWeight: 'bold' }}>{intelligence.trade_volume}</div>+ </div>+ </div>+ </div>++ {/* Trade Routes List */}+ <div style={{ flex: 1, overflowY: 'auto', padding: '12px', minHeight: 0 }}>+ <div style={{ color: '#00ff00', fontSize: '10px', fontWeight: 'bold', marginBottom: '8px', letterSpacing: '1px' }}>TRADE CORRIDORS</div>+ {tradeRoutes.map((route, idx) => (+ <div+ key={idx}+ onClick={() => setSelectedRoute(route)}+ style={{+ background: selectedRoute?.name === route.name ? '#1a1a1a' : '#0a0a0a',+ border: `1px solid ${route.status === 'critical' ? '#ff0000' : route.status === 'delayed' ? '#ffd700' : '#1a1a1a'}`,+ padding: '8px',+ marginBottom: '6px',+ cursor: 'pointer',+ transition: 'all 0.2s'+ }}+ onMouseEnter={(e) => e.currentTarget.style.background = '#1a1a1a'}+ onMouseLeave={(e) => e.currentTarget.style.background = selectedRoute?.name === route.name ? '#1a1a1a' : '#0a0a0a'}+ >+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '4px' }}>+ <span style={{ color: '#0ff', fontSize: '9px', fontWeight: 'bold' }}>{route.name}</span>+ <span style={{+ color: route.status === 'critical' ? '#ff0000' : route.status === 'delayed' ? '#ffd700' : '#00ff00',+ fontSize: '7px',+ padding: '2px 4px',+ background: '#000',+ border: `1px solid ${route.status === 'critical' ? '#ff0000' : route.status === 'delayed' ? '#ffd700' : '#00ff00'}`+ }}>+ {route.status.toUpperCase()}+ </span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: '#888', fontSize: '8px' }}>Value: {route.value}</span>+ <span style={{ color: '#888', fontSize: '8px' }}>Ships: {route.vessels}</span>+ </div>+ </div>+ ))}+ </div>++ {/* Map Controls */}+ <div style={{ padding: '12px', borderTop: '1px solid #1a1a1a' }}>+ <div style={{ color: '#00ff00', fontSize: '10px', fontWeight: 'bold', marginBottom: '8px', letterSpacing: '1px' }}>MAP CONTROLS</div>+ <div style={{ display: 'flex', gap: '6px', marginBottom: '6px' }}>+ <button+ onClick={() => {+ setShowRoutes(!showRoutes);+ if (mapRef.current?.contentWindow) {+ (mapRef.current.contentWindow as any).toggleRoutes?.();+ }+ }}+ style={{+ flex: 1,+ background: showRoutes ? '#0ff' : '#0a0a0a',+ color: showRoutes ? '#000' : '#0ff',+ border: '1px solid #0ff',+ padding: '6px',+ fontSize: '9px',+ cursor: 'pointer',+ fontWeight: 'bold'+ }}+ >+ ROUTES+ </button>+ <button+ onClick={() => {+ setShowShips(!showShips);+ if (mapRef.current?.contentWindow) {+ (mapRef.current.contentWindow as any).toggleShips?.();+ }+ }}+ style={{+ flex: 1,+ background: showShips ? '#0ff' : '#0a0a0a',+ color: showShips ? '#000' : '#0ff',+ border: '1px solid #0ff',+ padding: '6px',+ fontSize: '9px',+ cursor: 'pointer',+ fontWeight: 'bold'+ }}+ >+ VESSELS+ </button>+ </div>+ <button+ onClick={() => {+ clearMarkers();+ if (mapRef.current?.contentWindow) {+ (mapRef.current.contentWindow as any).clearMarkers?.();+ }+ }}+ style={{+ width: '100%',+ background: '#0a0a0a',+ color: '#ff0000',+ border: '1px solid #ff0000',+ padding: '6px',+ fontSize: '9px',+ cursor: 'pointer',+ fontWeight: 'bold'+ }}+ >+ CLEAR ALL MARKERS+ </button>+ </div>+ </div>++ {/* Center - Map */}+ <div style={{ flex: 1, position: 'relative', minWidth: 0, overflow: 'hidden' }}>+ <iframe+ ref={mapRef}+ srcDoc={mapHTML}+ style={{+ width: '100%',+ height: '100%',+ border: 'none',+ background: '#000'+ }}+ />+ {/* Map Overlay - Coordinates Display */}+ <div style={{+ position: 'absolute',+ bottom: '16px',+ left: '16px',+ background: 'rgba(0, 0, 0, 0.9)',+ border: '1px solid #0ff',+ padding: '8px 12px',+ color: '#0ff',+ fontSize: '9px',+ fontFamily: 'Consolas, monospace'+ }}>+ <div style={{ fontWeight: 'bold', marginBottom: '4px' }}>SATELLITE UPLINK ACTIVE</div>+ <div>CENTER: 20.0000° N, 75.0000° E</div>+ <div>ZOOM: 4 | TILES: ESRI World Imagery</div>+ </div>+ </div>++ {/* Right Sidebar - Marker Tools */}+ <div style={{ width: '280px', borderLeft: '1px solid #1a1a1a', display: 'flex', flexDirection: 'column', background: '#000', flexShrink: 0 }}>++ {/* Selected Route Details */}+ {selectedRoute && (+ <div style={{ padding: '12px', borderBottom: '1px solid #1a1a1a' }}>+ <div style={{ color: '#00ff00', fontSize: '10px', fontWeight: 'bold', marginBottom: '8px', letterSpacing: '1px' }}>ROUTE DETAILS</div>+ <div style={{ background: '#0a0a0a', border: '1px solid #1a1a1a', padding: '10px' }}>+ <div style={{ color: '#0ff', fontSize: '11px', fontWeight: 'bold', marginBottom: '8px' }}>{selectedRoute.name}</div>+ <div style={{ display: 'grid', gap: '6px', fontSize: '9px' }}>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: '#888' }}>Value:</span>+ <span style={{ color: '#fff' }}>{selectedRoute.value}</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: '#888' }}>Status:</span>+ <span style={{ color: selectedRoute.status === 'critical' ? '#ff0000' : selectedRoute.status === 'delayed' ? '#ffd700' : '#00ff00' }}>+ {selectedRoute.status.toUpperCase()}+ </span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: '#888' }}>Active Vessels:</span>+ <span style={{ color: '#fff' }}>{selectedRoute.vessels}</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: '#888' }}>Waypoints:</span>+ <span style={{ color: '#fff' }}>{selectedRoute.coordinates.length}</span>+ </div>+ </div>+ </div>+ </div>+ )}++ {/* Add Markers */}+ <div style={{ padding: '12px', borderBottom: '1px solid #1a1a1a' }}>+ <div style={{ color: '#00ff00', fontSize: '10px', fontWeight: 'bold', marginBottom: '8px', letterSpacing: '1px' }}>ADD TARGET</div>++ <div style={{ marginBottom: '8px' }}>+ <div style={{ color: '#888', fontSize: '8px', marginBottom: '4px' }}>MARKER TYPE</div>+ <select+ value={markerType}+ onChange={(e) => setMarkerType(e.target.value as MarkerData['type'])}+ style={{+ width: '100%',+ background: '#0a0a0a',+ color: '#0ff',+ border: '1px solid #1a1a1a',+ padding: '6px',+ fontSize: '9px'+ }}+ >+ <option value="Ship">🚢 Ship</option>+ <option value="Port">⚓ Port</option>+ <option value="Industry">🏭 Industry</option>+ <option value="Bank">🏦 Bank</option>+ <option value="Exchange">💱 Exchange</option>+ </select>+ </div>++ <div style={{ color: '#888', fontSize: '8px', marginBottom: '8px' }}>QUICK ADD PRESETS</div>+ <div style={{ display: 'grid', gap: '4px' }}>+ {presetLocations.map((preset, idx) => (+ <button+ key={idx}+ onClick={() => {+ addPreset(preset);+ if (mapRef.current?.contentWindow) {+ (mapRef.current.contentWindow as any).addMarker?.(preset.lat, preset.lng, preset.name, preset.type);+ }+ }}+ style={{+ background: '#0a0a0a',+ color: '#fff',+ border: '1px solid #1a1a1a',+ padding: '6px',+ fontSize: '9px',+ cursor: 'pointer',+ textAlign: 'left'+ }}+ onMouseEnter={(e) => e.currentTarget.style.borderColor = '#0ff'}+ onMouseLeave={(e) => e.currentTarget.style.borderColor = '#1a1a1a'}+ >+ {preset.name}+ </button>+ ))}+ </div>+ </div>++ {/* Markers List */}+ <div style={{ flex: 1, overflowY: 'auto', padding: '12px', minHeight: 0 }}>+ <div style={{ color: '#00ff00', fontSize: '10px', fontWeight: 'bold', marginBottom: '8px', letterSpacing: '1px' }}>+ TRACKED TARGETS ({markers.length})+ </div>+ {markers.length === 0 ? (+ <div style={{ color: '#444', fontSize: '9px', fontStyle: 'italic', padding: '8px' }}>+ No targets marked+ </div>+ ) : (+ markers.map((marker, idx) => (+ <div+ key={idx}+ style={{+ background: '#0a0a0a',+ border: '1px solid #1a1a1a',+ padding: '8px',+ marginBottom: '6px',+ fontSize: '9px'+ }}+ >+ <div style={{ color: '#0ff', fontWeight: 'bold', marginBottom: '4px' }}>{marker.title}</div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: '#888' }}>Type: {marker.type}</span>+ <span style={{ color: '#666', fontSize: '8px' }}>{marker.lat.toFixed(2)}°, {marker.lng.toFixed(2)}°</span>+ </div>+ </div>+ ))+ )}+ </div>++ {/* Info Panel */}+ <div style={{ padding: '12px', borderTop: '1px solid #1a1a1a', background: '#0a0a0a' }}>+ <div style={{ color: '#00ff00', fontSize: '9px', fontWeight: 'bold', marginBottom: '6px' }}>SYSTEM STATUS</div>+ <div style={{ fontSize: '8px', color: '#888', lineHeight: '1.4' }}>+ <div style={{ marginBottom: '4px' }}>+ <span style={{ color: '#0ff' }}>●</span> Satellite feed: ACTIVE+ </div>+ <div style={{ marginBottom: '4px' }}>+ <span style={{ color: '#0ff' }}>●</span> AIS transponders: ONLINE+ </div>+ <div style={{ marginBottom: '4px' }}>+ <span style={{ color: '#0ff' }}>●</span> Trade data: STREAMING+ </div>+ <div style={{ marginTop: '8px', padding: '6px', background: '#000', border: '1px solid #1a1a1a', color: '#ffd700' }}>+ ⚠ CLASSIFIED: For authorized personnel only+ </div>+ </div>+ </div>+ </div>+ </div>++ {/* Footer */}+ <div style={{+ borderTop: '2px solid #00ff00',+ padding: '8px 16px',+ background: 'linear-gradient(180deg, #000 0%, #0a0a0a 100%)',+ display: 'flex',+ justifyContent: 'space-between',+ alignItems: 'center',+ flexShrink: 0,+ flexWrap: 'wrap',+ gap: '12px',+ minHeight: '40px'+ }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '16px', fontSize: '9px', flexWrap: 'wrap' }}>+ <span style={{ color: '#00ff00', fontWeight: 'bold', whiteSpace: 'nowrap' }}>MARITIME INTEL v2.4.1</span>+ <span style={{ color: '#888' }}>|</span>+ <span style={{ color: '#0ff', whiteSpace: 'nowrap' }}>AIS Feed: ACTIVE</span>+ <span style={{ color: '#888' }}>|</span>+ <span style={{ color: '#0ff', whiteSpace: 'nowrap' }}>Satellite Link: NOMINAL</span>+ <span style={{ color: '#888' }}>|</span>+ <span style={{ color: '#0ff', whiteSpace: 'nowrap' }}>Data Latency: 2.3ms</span>+ </div>+ <div style={{ display: 'flex', alignItems: 'center', gap: '16px', fontSize: '9px', flexWrap: 'wrap' }}>+ <span style={{ color: '#888', whiteSpace: 'nowrap' }}>Powered by Leaflet.js + ESRI Imagery</span>+ <span style={{ color: '#888' }}>|</span>+ <span style={{ color: '#ffd700', whiteSpace: 'nowrap' }}>CLEARANCE: TOP SECRET // SCI</span>+ </div>+ </div>+ </div>+ );+}\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/tabs/MarketplaceTab.tsx b/fincept-terminal-desktop/src/components/tabs/MarketplaceTab.tsxnew file mode 100644index 000000000..640bad8d3--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/MarketplaceTab.tsx@@ -0,0 +1,355 @@+import React, { useState, useEffect } from 'react';++interface MarketProduct {+ id: string;+ type: 'DATA' | 'ALGO' | 'API' | 'MODEL' | 'SIGNAL' | 'PLUGIN';+ name: string;+ vendor: string;+ category: string;+ price: number;+ pricingModel: 'ONE_TIME' | 'MONTHLY' | 'ANNUAL' | 'USAGE_BASED' | 'FREE';+ shortDescription: string;+ rating: number;+ reviews: number;+ users: number;+ accuracy: string;+ latency: string;+ verified: boolean;+ trending: boolean;+ featured: boolean;+}++const MarketplaceTab: React.FC = () => {+ const [currentScreen, setCurrentScreen] = useState<'BROWSE' | 'DETAILS' | 'CART'>('BROWSE');+ const [selectedProduct, setSelectedProduct] = useState<MarketProduct | null>(null);+ const [selectedCategory, setSelectedCategory] = useState('ALL');+ const [searchQuery, setSearchQuery] = useState('');+ const [cartItems, setCartItems] = useState<string[]>([]);++ // Colors+ const C = {+ ORANGE: '#FFA500',+ WHITE: '#FFFFFF',+ RED: '#FF0000',+ GREEN: '#00C800',+ YELLOW: '#FFFF00',+ GRAY: '#787878',+ BLUE: '#6496FA',+ PURPLE: '#C864FF',+ CYAN: '#00FFFF',+ DARK_BG: '#000000',+ PANEL_BG: '#0a0a0a'+ };++ const products: MarketProduct[] = [+ {+ id: 'MKT001',+ type: 'DATA',+ name: 'Global Equity Real-Time Feed',+ vendor: 'Refinitiv Data Solutions',+ category: 'Market Data',+ price: 4999.00,+ pricingModel: 'MONTHLY',+ shortDescription: 'Real-time equity prices for 60,000+ global securities across 120+ exchanges',+ rating: 4.8,+ reviews: 2847,+ users: 12450,+ accuracy: '99.99%',+ latency: '<1ms',+ verified: true,+ trending: true,+ featured: true+ },+ {+ id: 'MKT002',+ type: 'ALGO',+ name: 'Quantum Alpha Strategy',+ vendor: 'QuantEdge Systems',+ category: 'Trading Algorithms',+ price: 15000.00,+ pricingModel: 'ANNUAL',+ shortDescription: 'ML-powered multi-factor equity strategy with proven 18.7% annual alpha',+ rating: 4.9,+ reviews: 1234,+ users: 3847,+ accuracy: '87.3%',+ latency: '<500ms',+ verified: true,+ trending: true,+ featured: true+ },+ {+ id: 'MKT003',+ type: 'API',+ name: 'Options Analytics Suite',+ vendor: 'DerivativeEdge Inc.',+ category: 'Derivatives',+ price: 0.05,+ pricingModel: 'USAGE_BASED',+ shortDescription: 'Complete options pricing, Greeks, and volatility analytics API',+ rating: 4.7,+ reviews: 3456,+ users: 18923,+ accuracy: '99.5%',+ latency: '<50ms',+ verified: true,+ trending: false,+ featured: true+ },+ {+ id: 'MKT004',+ type: 'MODEL',+ name: 'Credit Risk AI Model',+ vendor: 'RiskLab Analytics',+ category: 'Risk Management',+ price: 8500.00,+ pricingModel: 'MONTHLY',+ shortDescription: 'Deep learning model for corporate credit risk assessment',+ rating: 4.6,+ reviews: 892,+ users: 2341,+ accuracy: '91.2%',+ latency: 'N/A',+ verified: true,+ trending: false,+ featured: false+ },+ {+ id: 'MKT005',+ type: 'SIGNAL',+ name: 'Social Sentiment Signals',+ vendor: 'SentimentAlpha',+ category: 'Alternative Data',+ price: 2999.00,+ pricingModel: 'MONTHLY',+ shortDescription: 'Trading signals from social media sentiment analysis',+ rating: 4.4,+ reviews: 1678,+ users: 7823,+ accuracy: '73.8%',+ latency: '<1hr',+ verified: true,+ trending: true,+ featured: false+ },+ {+ id: 'MKT006',+ type: 'PLUGIN',+ name: 'Portfolio Risk Dashboard',+ vendor: 'Fincept Labs',+ category: 'Analytics',+ price: 0.00,+ pricingModel: 'FREE',+ shortDescription: 'Advanced portfolio risk analytics dashboard plugin',+ rating: 4.9,+ reviews: 5678,+ users: 28934,+ accuracy: '99.9%',+ latency: '<100ms',+ verified: true,+ trending: true,+ featured: true+ }+ ];++ const categories = [+ { name: 'ALL', count: products.length },+ { name: 'Market Data', count: 2 },+ { name: 'Trading Algorithms', count: 1 },+ { name: 'Derivatives', count: 1 },+ { name: 'Risk Management', count: 1 },+ { name: 'Alternative Data', count: 1 },+ { name: 'Analytics', count: 1 }+ ];++ const filteredProducts = products.filter(p =>+ (selectedCategory === 'ALL' || p.category === selectedCategory) &&+ (searchQuery === '' || p.name.toLowerCase().includes(searchQuery.toLowerCase()) || p.vendor.toLowerCase().includes(searchQuery.toLowerCase()))+ );++ const getTypeColor = (type: string) => {+ const colors: Record<string, string> = {+ DATA: C.BLUE, ALGO: C.GREEN, API: C.PURPLE, MODEL: C.CYAN, SIGNAL: C.YELLOW, PLUGIN: C.ORANGE+ };+ return colors[type] || C.WHITE;+ };++ return (+ <div style={{ width: '100%', height: '100%', backgroundColor: C.DARK_BG, color: C.WHITE, fontFamily: 'Consolas, monospace', display: 'flex', flexDirection: 'column' }}>+ <style>{`+ .marketplace-scroll::-webkit-scrollbar { width: 8px; }+ .marketplace-scroll::-webkit-scrollbar-track { background: #1a1a1a; }+ .marketplace-scroll::-webkit-scrollbar-thumb { background: #404040; border-radius: 4px; }+ .marketplace-scroll::-webkit-scrollbar-thumb:hover { background: #525252; }+ `}</style>++ {/* Header */}+ <div style={{ backgroundColor: C.PANEL_BG, borderBottom: `2px solid ${C.GRAY}`, padding: '8px 16px' }}>+ <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>+ <span style={{ color: C.ORANGE, fontWeight: 'bold', fontSize: '16px' }}>FINCEPT MARKETPLACE</span>+ <span style={{ color: C.GRAY }}>|</span>+ <span style={{ color: C.CYAN, fontSize: '12px' }}>{products.length} Products Available</span>+ </div>+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>+ <button onClick={() => setCurrentScreen('BROWSE')} style={{ padding: '6px 12px', backgroundColor: currentScreen === 'BROWSE' ? C.ORANGE : C.DARK_BG, border: `2px solid ${C.GRAY}`, color: currentScreen === 'BROWSE' ? C.DARK_BG : C.WHITE, fontSize: '11px', fontWeight: 'bold', cursor: 'pointer', fontFamily: 'Consolas, monospace' }}>+ BROWSE+ </button>+ <button onClick={() => setCurrentScreen('CART')} style={{ padding: '6px 12px', backgroundColor: currentScreen === 'CART' ? C.ORANGE : C.DARK_BG, border: `2px solid ${C.GRAY}`, color: currentScreen === 'CART' ? C.DARK_BG : C.WHITE, fontSize: '11px', fontWeight: 'bold', cursor: 'pointer', fontFamily: 'Consolas, monospace' }}>+ 🛒 CART {cartItems.length > 0 && `(${cartItems.length})`}+ </button>+ </div>+ </div>+ </div>++ {/* Content */}+ <div style={{ flex: 1, display: 'flex', flexDirection: 'column', minHeight: 0 }}>+ {currentScreen === 'BROWSE' && (+ <>+ {/* Search */}+ <div style={{ padding: '12px', backgroundColor: C.PANEL_BG, borderBottom: `2px solid ${C.GRAY}` }}>+ <div style={{ display: 'flex', gap: '12px', marginBottom: '12px' }}>+ <input type="text" placeholder="Search products..." value={searchQuery} onChange={(e) => setSearchQuery(e.target.value)} style={{ flex: 1, padding: '10px 16px', backgroundColor: C.DARK_BG, border: `2px solid ${C.GRAY}`, color: C.WHITE, fontSize: '14px', fontFamily: 'Consolas, monospace' }} />+ <button style={{ padding: '10px 24px', backgroundColor: C.ORANGE, border: 'none', color: C.DARK_BG, fontSize: '14px', fontWeight: 'bold', cursor: 'pointer', fontFamily: 'Consolas, monospace' }}>SEARCH</button>+ </div>+ <div style={{ display: 'flex', gap: '8px', flexWrap: 'wrap' }}>+ {categories.map((cat) => (+ <button key={cat.name} onClick={() => setSelectedCategory(cat.name)} style={{ padding: '8px 16px', backgroundColor: selectedCategory === cat.name ? C.ORANGE : C.DARK_BG, border: `2px solid ${selectedCategory === cat.name ? C.ORANGE : C.GRAY}`, color: selectedCategory === cat.name ? C.DARK_BG : C.WHITE, fontSize: '12px', fontWeight: 'bold', cursor: 'pointer', fontFamily: 'Consolas, monospace' }}>+ {cat.name.toUpperCase()} ({cat.count})+ </button>+ ))}+ </div>+ </div>++ {/* Products */}+ <div className="marketplace-scroll" style={{ flex: 1, overflowY: 'auto', backgroundColor: '#050505', padding: '16px' }}>+ <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(380px, 1fr))', gap: '16px' }}>+ {filteredProducts.map((product) => (+ <div key={product.id} style={{ backgroundColor: C.PANEL_BG, border: `2px solid ${C.GRAY}`, borderLeft: `6px solid ${getTypeColor(product.type)}`, padding: '16px' }}>+ <div style={{ display: 'inline-block', backgroundColor: getTypeColor(product.type), color: C.DARK_BG, padding: '4px 10px', fontSize: '10px', fontWeight: 'bold', marginBottom: '8px' }}>+ {product.type}+ </div>+ <div style={{ color: C.WHITE, fontSize: '16px', fontWeight: 'bold', marginBottom: '4px' }}>{product.name}</div>+ <div style={{ color: C.GRAY, fontSize: '12px', marginBottom: '8px' }}>by <span style={{ color: C.CYAN }}>{product.vendor}</span></div>+ <div style={{ color: C.WHITE, fontSize: '13px', lineHeight: '1.5', marginBottom: '12px', minHeight: '60px' }}>{product.shortDescription}</div>+ <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '8px', marginBottom: '12px', padding: '10px', backgroundColor: 'rgba(255,255,255,0.03)', border: `1px solid ${C.GRAY}` }}>+ <div>+ <div style={{ color: C.GRAY, fontSize: '9px' }}>RATING</div>+ <div style={{ color: C.YELLOW, fontSize: '13px', fontWeight: 'bold' }}>★ {product.rating} ({product.reviews})</div>+ </div>+ <div>+ <div style={{ color: C.GRAY, fontSize: '9px' }}>USERS</div>+ <div style={{ color: C.CYAN, fontSize: '13px', fontWeight: 'bold' }}>{product.users.toLocaleString()}</div>+ </div>+ </div>+ <div style={{ display: 'flex', gap: '8px' }}>+ <button onClick={() => { setSelectedProduct(product); setCurrentScreen('DETAILS'); }} style={{ flex: 1, padding: '10px', backgroundColor: C.DARK_BG, border: `2px solid ${C.BLUE}`, color: C.BLUE, fontSize: '12px', fontWeight: 'bold', cursor: 'pointer', fontFamily: 'Consolas, monospace' }}>+ VIEW DETAILS+ </button>+ <button onClick={() => !cartItems.includes(product.id) && setCartItems([...cartItems, product.id])} style={{ flex: 1, padding: '10px', backgroundColor: cartItems.includes(product.id) ? C.GREEN : C.DARK_BG, border: `2px solid ${C.GREEN}`, color: cartItems.includes(product.id) ? C.DARK_BG : C.GREEN, fontSize: '12px', fontWeight: 'bold', cursor: 'pointer', fontFamily: 'Consolas, monospace' }}>+ {cartItems.includes(product.id) ? '✓ IN CART' : 'ADD TO CART'}+ </button>+ </div>+ </div>+ ))}+ </div>+ </div>+ </>+ )}++ {currentScreen === 'DETAILS' && selectedProduct && (+ <>+ <div style={{ padding: '12px', backgroundColor: C.PANEL_BG, borderBottom: `2px solid ${C.GRAY}` }}>+ <button onClick={() => setCurrentScreen('BROWSE')} style={{ padding: '8px 16px', backgroundColor: C.DARK_BG, border: `2px solid ${C.GRAY}`, color: C.WHITE, fontSize: '12px', fontWeight: 'bold', cursor: 'pointer', fontFamily: 'Consolas, monospace' }}>+ ← BACK TO MARKETPLACE+ </button>+ </div>+ <div className="marketplace-scroll" style={{ flex: 1, overflowY: 'auto', backgroundColor: '#050505', padding: '20px' }}>+ <div style={{ maxWidth: '1200px', margin: '0 auto' }}>+ <div style={{ backgroundColor: C.PANEL_BG, border: `2px solid ${C.GRAY}`, borderLeft: `8px solid ${getTypeColor(selectedProduct.type)}`, padding: '24px', marginBottom: '20px' }}>+ <div style={{ display: 'inline-block', backgroundColor: getTypeColor(selectedProduct.type), color: C.DARK_BG, padding: '6px 14px', fontSize: '12px', fontWeight: 'bold', marginBottom: '12px' }}>+ {selectedProduct.type}+ </div>+ <div style={{ color: C.WHITE, fontSize: '28px', fontWeight: 'bold', marginBottom: '8px' }}>{selectedProduct.name}</div>+ <div style={{ color: C.GRAY, fontSize: '16px', marginBottom: '12px' }}>+ by <span style={{ color: C.CYAN, fontWeight: 'bold' }}>{selectedProduct.vendor}</span> • <span style={{ color: C.BLUE }}>{selectedProduct.category}</span>+ </div>+ <div style={{ color: C.GREEN, fontSize: '36px', fontWeight: 'bold', marginTop: '16px' }}>+ {selectedProduct.pricingModel === 'FREE' ? 'FREE' : `$${selectedProduct.price.toLocaleString()}`}+ <span style={{ color: C.GRAY, fontSize: '13px', marginLeft: '8px' }}>+ {selectedProduct.pricingModel === 'MONTHLY' && '/ month'}+ {selectedProduct.pricingModel === 'ANNUAL' && '/ year'}+ {selectedProduct.pricingModel === 'USAGE_BASED' && '/ request'}+ </span>+ </div>+ <button onClick={() => !cartItems.includes(selectedProduct.id) && setCartItems([...cartItems, selectedProduct.id])} style={{ marginTop: '16px', padding: '14px 32px', backgroundColor: cartItems.includes(selectedProduct.id) ? C.GREEN : C.DARK_BG, border: `2px solid ${C.GREEN}`, color: cartItems.includes(selectedProduct.id) ? C.DARK_BG : C.GREEN, fontSize: '14px', fontWeight: 'bold', cursor: 'pointer', fontFamily: 'Consolas, monospace' }}>+ {cartItems.includes(selectedProduct.id) ? '✓ ADDED TO CART' : 'ADD TO CART'}+ </button>+ </div>+ <div style={{ backgroundColor: C.PANEL_BG, border: `2px solid ${C.GRAY}`, padding: '20px' }}>+ <div style={{ color: C.ORANGE, fontSize: '16px', fontWeight: 'bold', marginBottom: '12px' }}>PRODUCT DESCRIPTION</div>+ <div style={{ color: C.WHITE, fontSize: '14px', lineHeight: '1.7' }}>{selectedProduct.shortDescription}</div>+ </div>+ </div>+ </div>+ </>+ )}++ {currentScreen === 'CART' && (+ <>+ <div style={{ padding: '16px', backgroundColor: C.PANEL_BG, borderBottom: `2px solid ${C.GRAY}` }}>+ <div style={{ color: C.ORANGE, fontSize: '20px', fontWeight: 'bold' }}>SHOPPING CART ({cartItems.length} items)</div>+ </div>+ <div className="marketplace-scroll" style={{ flex: 1, overflowY: 'auto', backgroundColor: '#050505', padding: '20px' }}>+ <div style={{ maxWidth: '1000px', margin: '0 auto' }}>+ {cartItems.length === 0 ? (+ <div style={{ backgroundColor: C.PANEL_BG, border: `2px solid ${C.GRAY}`, padding: '40px', textAlign: 'center' }}>+ <div style={{ color: C.GRAY, fontSize: '18px', marginBottom: '16px' }}>Your cart is empty</div>+ <button onClick={() => setCurrentScreen('BROWSE')} style={{ padding: '12px 24px', backgroundColor: C.ORANGE, border: 'none', color: C.DARK_BG, fontSize: '14px', fontWeight: 'bold', cursor: 'pointer', fontFamily: 'Consolas, monospace' }}>+ BROWSE MARKETPLACE+ </button>+ </div>+ ) : (+ products.filter(p => cartItems.includes(p.id)).map((product) => (+ <div key={product.id} style={{ backgroundColor: C.PANEL_BG, border: `2px solid ${C.GRAY}`, borderLeft: `6px solid ${getTypeColor(product.type)}`, padding: '20px', marginBottom: '16px', display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>+ <div style={{ flex: 1 }}>+ <div style={{ color: C.WHITE, fontSize: '18px', fontWeight: 'bold', marginBottom: '4px' }}>{product.name}</div>+ <div style={{ color: C.GRAY, fontSize: '13px', marginBottom: '8px' }}>by {product.vendor}</div>+ </div>+ <div style={{ textAlign: 'right', marginLeft: '24px' }}>+ <div style={{ color: C.GREEN, fontSize: '24px', fontWeight: 'bold', marginBottom: '8px' }}>+ {product.pricingModel === 'FREE' ? 'FREE' : `$${product.price.toLocaleString()}`}+ </div>+ <button onClick={() => setCartItems(cartItems.filter(id => id !== product.id))} style={{ padding: '8px 16px', backgroundColor: C.DARK_BG, border: `2px solid ${C.RED}`, color: C.RED, fontSize: '11px', fontWeight: 'bold', cursor: 'pointer', fontFamily: 'Consolas, monospace' }}>+ REMOVE+ </button>+ </div>+ </div>+ ))+ )}+ </div>+ </div>+ </>+ )}+ </div>++ {/* Footer */}+ <div style={{ borderTop: `3px solid ${C.ORANGE}`, backgroundColor: C.PANEL_BG, padding: '12px 16px', fontSize: '11px' }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '16px' }}>+ <span style={{ color: C.ORANGE, fontWeight: 'bold', fontSize: '13px' }}>FINCEPT MARKETPLACE v3.0</span>+ <span style={{ color: C.GRAY }}>|</span>+ <span style={{ color: C.CYAN }}>🔒 SECURE PRODUCTS</span>+ <span style={{ color: C.GRAY }}>|</span>+ <span style={{ color: C.GREEN }}>✓ VERIFIED VENDORS</span>+ </div>+ <div style={{ color: C.GRAY }}>+ Screen: <span style={{ color: C.ORANGE, fontWeight: 'bold' }}>{currentScreen}</span> | Showing: {filteredProducts.length} / {products.length}+ </div>+ </div>+ </div>+ </div>+ );+};++export default MarketplaceTab;\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/tabs/MarketsTab.tsx b/fincept-terminal-desktop/src/components/tabs/MarketsTab.tsxindex c529d3c65..3efd401c8 100644--- a/fincept-terminal-desktop/src/components/tabs/MarketsTab.tsx+++ b/fincept-terminal-desktop/src/components/tabs/MarketsTab.tsx@@ -305,6 +305,23 @@ const MarketsTab: React.FC = () => {display: 'flex',flexDirection: 'column'}}>+ <style>{`+ /* Custom scrollbar styles */+ *::-webkit-scrollbar {+ width: 8px;+ height: 8px;+ }+ *::-webkit-scrollbar-track {+ background: #1a1a1a;+ }+ *::-webkit-scrollbar-thumb {+ background: #404040;+ border-radius: 4px;+ }+ *::-webkit-scrollbar-thumb:hover {+ background: #525252;+ }+ `}</style>{/* Header Bar (exact from Python) */}<div style={{display: 'flex',diff --git a/fincept-terminal-desktop/src/components/tabs/NewsTab.tsx b/fincept-terminal-desktop/src/components/tabs/NewsTab.tsxindex ec77e8e88..0bf85eec1 100644--- a/fincept-terminal-desktop/src/components/tabs/NewsTab.tsx+++ b/fincept-terminal-desktop/src/components/tabs/NewsTab.tsx@@ -1,272 +1,685 @@import React, { useState, useEffect } from 'react';-import { ExternalLink, Clock, TrendingUp, Globe, DollarSign, Building } from 'lucide-react';interface NewsArticle {id: string;- title: string;+ time: string;+ priority: 'FLASH' | 'URGENT' | 'BREAKING' | 'ROUTINE';+ category: string;+ headline: string;summary: string;source: string;- publishedAt: string;- category: string;- url: string;- sentiment: 'positive' | 'negative' | 'neutral';+ region: string;+ sentiment: 'BULLISH' | 'BEARISH' | 'NEUTRAL';+ impact: 'HIGH' | 'MEDIUM' | 'LOW';+ tickers: string[];+ classification: string;}-interface NewsCategory {- key: string;- label: string;- icon: React.ReactNode;- color: string;+interface MarketAlert {+ time: string;+ type: 'EARNINGS' | 'MERGER' | 'REGULATORY' | 'ECONOMIC' | 'TECHNICAL';+ message: string;+ severity: 'CRITICAL' | 'HIGH' | 'MEDIUM' | 'LOW';+ affected: string[];}const NewsTab: React.FC = () => {- const [activeCategory, setActiveCategory] = useState('all');- const [articles, setArticles] = useState<NewsArticle[]>([+ const [currentTime, setCurrentTime] = useState(new Date());+ const [activeFilter, setActiveFilter] = useState('ALL');+ const [newsTicker, setNewsTicker] = useState(0);+ const [alertCount, setAlertCount] = useState(47);++ // Bloomberg color scheme (exact from DearPyGUI)+ const BLOOMBERG_ORANGE = '#FFA500';+ const BLOOMBERG_WHITE = '#FFFFFF';+ const BLOOMBERG_RED = '#FF0000';+ const BLOOMBERG_GREEN = '#00C800';+ const BLOOMBERG_YELLOW = '#FFFF00';+ const BLOOMBERG_GRAY = '#787878';+ const BLOOMBERG_BLUE = '#6496FA';+ const BLOOMBERG_PURPLE = '#C864FF';+ const BLOOMBERG_CYAN = '#00FFFF';+ const BLOOMBERG_DARK_BG = '#000000';+ const BLOOMBERG_PANEL_BG = '#0a0a0a';++ useEffect(() => {+ const timer = setInterval(() => {+ setCurrentTime(new Date());+ setNewsTicker(prev => prev + 1);+ if (Math.random() > 0.7) setAlertCount(prev => prev + 1);+ }, 3000);+ return () => clearInterval(timer);+ }, []);++ const newsArticles: NewsArticle[] = [{id: '1',- title: 'Federal Reserve Signals Potential Rate Cut in Q2 2024',- summary: 'Fed officials hint at possible monetary policy adjustments as inflation shows signs of cooling across major economic indicators.',- source: 'Reuters',- publishedAt: '2 minutes ago',- category: 'economics',- url: '#',- sentiment: 'positive'+ time: '16:47:23',+ priority: 'FLASH',+ category: 'MARKETS',+ headline: 'Federal Reserve Signals Emergency Rate Cut - 75bps Expected',+ summary: 'Fed Chair Powell indicates potential emergency monetary policy action following inflation data showing 2.8% core PCE. Markets rally on dovish pivot expectations.',+ source: 'BLOOMBERG',+ region: 'US',+ sentiment: 'BULLISH',+ impact: 'HIGH',+ tickers: ['SPY', 'QQQ', 'TLT', 'USD'],+ classification: 'PUBLIC'},{id: '2',- title: 'Tech Stocks Rally on AI Investment Surge',- summary: 'Major technology companies see significant gains as artificial intelligence investments continue to drive market optimism.',- source: 'Bloomberg',- publishedAt: '5 minutes ago',- category: 'technology',- url: '#',- sentiment: 'positive'+ time: '16:45:12',+ priority: 'URGENT',+ category: 'EARNINGS',+ headline: 'Apple Q4 Earnings Beat - iPhone Sales Surge 18% YoY',+ summary: 'AAPL reports $1.89 EPS vs $1.70 est. Revenue $89.5B vs $94.5B est. Services revenue hits record $22.3B. China sales rebound strongly.',+ source: 'REUTERS',+ region: 'US',+ sentiment: 'BULLISH',+ impact: 'HIGH',+ tickers: ['AAPL', 'NASDAQ', 'QQQ'],+ classification: 'PUBLIC'},{id: '3',- title: 'Oil Prices Drop on Increased Production Outlook',- summary: 'Crude oil futures decline as OPEC+ members signal potential production increases in response to global demand.',- source: 'Wall Street Journal',- publishedAt: '8 minutes ago',- category: 'commodities',- url: '#',- sentiment: 'negative'+ time: '16:43:56',+ priority: 'BREAKING',+ category: 'GEOPOLITICS',+ headline: 'China Announces $2.8T Infrastructure Investment Plan',+ summary: 'Beijing unveils massive Belt & Road 2.0 initiative targeting Southeast Asia and Africa. Focus on AI, renewable energy, and digital infrastructure.',+ source: 'XINHUA',+ region: 'ASIA',+ sentiment: 'BULLISH',+ impact: 'MEDIUM',+ tickers: ['FXI', 'ASHR', 'MCHI', 'EEM'],+ classification: 'PUBLIC'},{id: '4',- title: 'European Markets Open Higher on GDP Data',- summary: 'European indices gain as stronger-than-expected GDP growth data boosts investor confidence in regional recovery.',- source: 'Financial Times',- publishedAt: '12 minutes ago',- category: 'markets',- url: '#',- sentiment: 'positive'+ time: '16:42:31',+ priority: 'URGENT',+ category: 'ENERGY',+ headline: 'Saudi Arabia Extends Oil Production Cuts Through Q2 2024',+ summary: 'Kingdom maintains 1M bpd voluntary cut. OPEC+ meeting confirms coordinated supply management. Brent crude jumps 4.2% to $87.45.',+ source: 'WSJ',+ region: 'MIDEAST',+ sentiment: 'BULLISH',+ impact: 'HIGH',+ tickers: ['USO', 'XLE', 'CVX', 'XOM'],+ classification: 'PUBLIC'},{id: '5',- title: 'Cryptocurrency Regulation Bill Advances in Senate',- summary: 'Bipartisan cryptocurrency regulation framework moves forward, providing clearer guidelines for digital asset trading.',- source: 'CNBC',- publishedAt: '15 minutes ago',- category: 'cryptocurrency',- url: '#',- sentiment: 'neutral'+ time: '16:41:08',+ priority: 'FLASH',+ category: 'CRYPTO',+ headline: 'Bitcoin ETF Approval - SEC Greenlights 11 Spot ETFs',+ summary: 'Historic regulatory milestone as SEC approves spot Bitcoin ETFs from BlackRock, Fidelity, Grayscale. BTC surges 12% to $48,500.',+ source: 'COINDESK',+ region: 'US',+ sentiment: 'BULLISH',+ impact: 'HIGH',+ tickers: ['BTC', 'GBTC', 'COIN', 'MSTR'],+ classification: 'PUBLIC'},{id: '6',- title: 'Banking Sector Shows Strong Q4 Earnings',- summary: 'Major banks report better-than-expected quarterly results, driven by higher interest margins and loan growth.',- source: 'MarketWatch',- publishedAt: '18 minutes ago',- category: 'banking',- url: '#',- sentiment: 'positive'+ time: '16:39:45',+ priority: 'URGENT',+ category: 'TECH',+ headline: 'Microsoft Azure AI Revenue Hits $1B Quarterly Run Rate',+ summary: 'MSFT Azure OpenAI services exceed $1B ARR. Enterprise AI adoption accelerates. Cloud segment shows 28% growth. Stock up 6% after hours.',+ source: 'CNBC',+ region: 'US',+ sentiment: 'BULLISH',+ impact: 'MEDIUM',+ tickers: ['MSFT', 'NVDA', 'GOOGL', 'META'],+ classification: 'PUBLIC'},{id: '7',- title: 'Supply Chain Disruptions Impact Manufacturing',- summary: 'Global manufacturing faces headwinds as supply chain bottlenecks persist in key industrial sectors.',- source: 'Associated Press',- publishedAt: '22 minutes ago',- category: 'economics',- url: '#',- sentiment: 'negative'+ time: '16:38:22',+ priority: 'BREAKING',+ category: 'BANKING',+ headline: 'JPMorgan Reports Record Q4 Net Income - $15.2B',+ summary: 'JPM beats on all metrics. Net interest income $22.9B vs $22.1B est. Credit loss provisions down 34%. Jamie Dimon optimistic on 2024 outlook.',+ source: 'FINANCIAL TIMES',+ region: 'US',+ sentiment: 'BULLISH',+ impact: 'MEDIUM',+ tickers: ['JPM', 'BAC', 'WFC', 'XLF'],+ classification: 'PUBLIC'},{id: '8',- title: 'Green Energy Investments Reach Record High',- summary: 'Renewable energy sector attracts unprecedented investment levels as governments accelerate clean energy transitions.',- source: 'Reuters',- publishedAt: '25 minutes ago',- category: 'energy',- url: '#',- sentiment: 'positive'+ time: '16:37:01',+ priority: 'ROUTINE',+ category: 'ECONOMIC',+ headline: 'EU GDP Growth Revised Higher - 0.6% QoQ vs 0.4% Est',+ summary: 'Eurostat revises Q3 GDP growth upward. German manufacturing shows resilience. ECB likely to pause rate hikes. EUR/USD rallies to 1.0890.',+ source: 'EUROSTAT',+ region: 'EUROPE',+ sentiment: 'NEUTRAL',+ impact: 'LOW',+ tickers: ['EZU', 'FEZ', 'VGK', 'EUR'],+ classification: 'PUBLIC'}- ]);-- const categories: NewsCategory[] = [- { key: 'all', label: 'ALL NEWS', icon: <Globe size={16} />, color: 'text-blue-400' },- { key: 'markets', label: 'MARKETS', icon: <TrendingUp size={16} />, color: 'text-green-400' },- { key: 'economics', label: 'ECONOMICS', icon: <DollarSign size={16} />, color: 'text-yellow-400' },- { key: 'technology', label: 'TECHNOLOGY', icon: <Building size={16} />, color: 'text-purple-400' },- { key: 'banking', label: 'BANKING', icon: <Building size={16} />, color: 'text-orange-400' },- { key: 'commodities', label: 'COMMODITIES', icon: <TrendingUp size={16} />, color: 'text-red-400' },- { key: 'cryptocurrency', label: 'CRYPTO', icon: <DollarSign size={16} />, color: 'text-cyan-400' },- { key: 'energy', label: 'ENERGY', icon: <Globe size={16} />, color: 'text-emerald-400' }];- const [lastUpdated, setLastUpdated] = useState(new Date());-- useEffect(() => {- const timer = setInterval(() => {- setLastUpdated(new Date());- }, 30000);-- return () => clearInterval(timer);- }, []);+ const marketAlerts: MarketAlert[] = [+ {+ time: '16:48:15',+ type: 'TECHNICAL',+ message: 'S&P 500 breaks above 4,800 resistance - Bullish momentum building',+ severity: 'HIGH',+ affected: ['SPY', 'SPX', 'ES']+ },+ {+ time: '16:46:33',+ type: 'ECONOMIC',+ message: 'VIX drops below 12 - Complacency levels reaching extremes',+ severity: 'MEDIUM',+ affected: ['VIX', 'VXX', 'UVXY']+ },+ {+ time: '16:44:27',+ type: 'EARNINGS',+ message: 'Tesla earnings whisper numbers suggest 15% beat possible',+ severity: 'HIGH',+ affected: ['TSLA', 'EV sector']+ },+ {+ time: '16:42:18',+ type: 'REGULATORY',+ message: 'FDA fast-tracks Alzheimer drug - Biotech sector surge expected',+ severity: 'MEDIUM',+ affected: ['XBI', 'BIIB', 'SGEN']+ }+ ];- const filteredArticles = activeCategory === 'all'- ? articles- : articles.filter(article => article.category === activeCategory);+ const getPriorityColor = (priority: string) => {+ switch (priority) {+ case 'FLASH': return BLOOMBERG_RED;+ case 'URGENT': return BLOOMBERG_ORANGE;+ case 'BREAKING': return BLOOMBERG_YELLOW;+ case 'ROUTINE': return BLOOMBERG_GREEN;+ default: return BLOOMBERG_GRAY;+ }+ };const getSentimentColor = (sentiment: string) => {switch (sentiment) {- case 'positive': return 'text-green-400';- case 'negative': return 'text-red-400';- default: return 'text-gray-400';+ case 'BULLISH': return BLOOMBERG_GREEN;+ case 'BEARISH': return BLOOMBERG_RED;+ case 'NEUTRAL': return BLOOMBERG_YELLOW;+ default: return BLOOMBERG_GRAY;}};- const getSentimentIndicator = (sentiment: string) => {- switch (sentiment) {- case 'positive': return '↗';- case 'negative': return '↘';- default: return '→';+ const getImpactColor = (impact: string) => {+ switch (impact) {+ case 'HIGH': return BLOOMBERG_RED;+ case 'MEDIUM': return BLOOMBERG_YELLOW;+ case 'LOW': return BLOOMBERG_GREEN;+ default: return BLOOMBERG_GRAY;+ }+ };++ const getSeverityColor = (severity: string) => {+ switch (severity) {+ case 'CRITICAL': return BLOOMBERG_RED;+ case 'HIGH': return BLOOMBERG_ORANGE;+ case 'MEDIUM': return BLOOMBERG_YELLOW;+ case 'LOW': return BLOOMBERG_GREEN;+ default: return BLOOMBERG_GRAY;}};+ const filteredNews = activeFilter === 'ALL'+ ? newsArticles+ : newsArticles.filter(article => article.category === activeFilter);+return (- <div className="h-full bg-black text-white flex flex-col">- {/* Category Navigation */}- <div className="bg-gray-900 border-b border-gray-700 p-2">- <div className="flex flex-wrap gap-2">- {categories.map((category) => (- <button- key={category.key}- onClick={() => setActiveCategory(category.key)}- className={`flex items-center gap-2 px-3 py-2 text-sm font-medium rounded transition-colors ${- activeCategory === category.key- ? 'bg-orange-600 text-white'- : 'bg-gray-800 text-gray-300 hover:bg-gray-700'- }`}- >- <span className={category.color}>{category.icon}</span>- <span>{category.label}</span>- </button>- ))}+ <div style={{+ height: '100%',+ backgroundColor: BLOOMBERG_DARK_BG,+ color: BLOOMBERG_WHITE,+ fontFamily: 'Consolas, monospace',+ overflow: 'hidden',+ display: 'flex',+ flexDirection: 'column',+ fontSize: '12px'+ }}>+ {/* Complex Header with News Ticker */}+ <div style={{+ backgroundColor: BLOOMBERG_PANEL_BG,+ borderBottom: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '4px 8px',+ flexShrink: 0+ }}>+ {/* Main Status Line */}+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px', fontSize: '13px', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_ORANGE, fontWeight: 'bold' }}>BLOOMBERG PROFESSIONAL NEWS</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_RED, fontWeight: 'bold', animation: 'blink 1s infinite' }}>BREAKING NEWS</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_YELLOW }}>ALERTS: {alertCount}</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_GREEN }}>● LIVE FEED</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_WHITE }}>{currentTime.toISOString().replace('T', ' ').substring(0, 19)} UTC</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_BLUE }}>UPDATES: {newsTicker}</span></div>- </div>- {/* Header */}- <div className="bg-gray-800 border-b border-gray-700 p-4">- <div className="flex justify-between items-center">- <h1 className="text-xl font-bold text-orange-500">- FINANCIAL NEWS ANALYSIS- </h1>- <div className="flex items-center gap-4 text-sm text-gray-400">- <div className="flex items-center gap-1">- <Clock size={14} />- <span>Last Updated: {lastUpdated.toLocaleTimeString()}</span>+ {/* News Ticker */}+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px', fontSize: '11px', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_YELLOW, fontWeight: 'bold' }}>TICKER:</span>+ <div style={{+ flex: 1,+ overflow: 'hidden',+ whiteSpace: 'nowrap'+ }}>+ <div style={{+ display: 'inline-block',+ animation: 'scroll-left 60s linear infinite',+ color: BLOOMBERG_WHITE+ }}>+ 🔴 FED RATE CUT EXPECTED • AAPL BEATS Q4 EARNINGS • CHINA $2.8T INFRASTRUCTURE PLAN • SAUDI EXTENDS OIL CUTS •+ BITCOIN ETF APPROVED • MSFT AZURE AI $1B+ • JPM RECORD Q4 PROFIT • EU GDP REVISED HIGHER •+ S&P 500 BREAKS 4800 • VIX BELOW 12 • TESLA EARNINGS BEAT EXPECTED • FDA BIOTECH APPROVAL</div>- <div className="text-green-400">● LIVE FEED</div></div></div>++ {/* Sources and Stats */}+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px', fontSize: '11px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>SOURCES:</span>+ <span style={{ color: BLOOMBERG_GREEN }}>BLOOMBERG●</span>+ <span style={{ color: BLOOMBERG_GREEN }}>REUTERS●</span>+ <span style={{ color: BLOOMBERG_GREEN }}>WSJ●</span>+ <span style={{ color: BLOOMBERG_GREEN }}>FT●</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_GRAY }}>PROCESSING:</span>+ <span style={{ color: BLOOMBERG_CYAN }}>2.3M articles/day</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_GRAY }}>SENTIMENT:</span>+ <span style={{ color: BLOOMBERG_GREEN }}>BULLISH 62%</span>+ <span style={{ color: BLOOMBERG_RED }}>BEARISH 23%</span>+ <span style={{ color: BLOOMBERG_YELLOW }}>NEUTRAL 15%</span>+ </div></div>- {/* News Counter */}- <div className="bg-gray-900 border-b border-gray-700 p-3">- <div className="flex justify-between items-center text-sm">- <div>- <span className="text-gray-400">Showing </span>- <span className="text-white font-semibold">{filteredArticles.length}</span>- <span className="text-gray-400"> articles</span>- {activeCategory !== 'all' && (- <>- <span className="text-gray-400"> in </span>- <span className="text-orange-400">- {categories.find(c => c.key === activeCategory)?.label}- </span>- </>- )}- </div>- <div className="flex gap-4">- <span className="text-gray-400">Positive: </span>- <span className="text-green-400">{articles.filter(a => a.sentiment === 'positive').length}</span>- <span className="text-gray-400">Negative: </span>- <span className="text-red-400">{articles.filter(a => a.sentiment === 'negative').length}</span>- </div>+ {/* Function Keys Bar */}+ <div style={{+ backgroundColor: BLOOMBERG_PANEL_BG,+ borderBottom: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '2px 4px',+ flexShrink: 0+ }}>+ <div style={{ display: 'grid', gridTemplateColumns: 'repeat(12, 1fr)', gap: '2px' }}>+ {[+ { key: "F1", label: "ALL", filter: "ALL" },+ { key: "F2", label: "MARKETS", filter: "MARKETS" },+ { key: "F3", label: "EARNINGS", filter: "EARNINGS" },+ { key: "F4", label: "ECON", filter: "ECONOMIC" },+ { key: "F5", label: "TECH", filter: "TECH" },+ { key: "F6", label: "ENERGY", filter: "ENERGY" },+ { key: "F7", label: "BANKING", filter: "BANKING" },+ { key: "F8", label: "CRYPTO", filter: "CRYPTO" },+ { key: "F9", label: "GEOPO", filter: "GEOPOLITICS" },+ { key: "F10", label: "ALERTS", filter: "ALERTS" },+ { key: "F11", label: "SEARCH", filter: "SEARCH" },+ { key: "F12", label: "SETTINGS", filter: "SETTINGS" }+ ].map(item => (+ <button key={item.key}+ onClick={() => setActiveFilter(item.filter)}+ style={{+ backgroundColor: activeFilter === item.filter ? BLOOMBERG_ORANGE : BLOOMBERG_DARK_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ color: activeFilter === item.filter ? BLOOMBERG_DARK_BG : BLOOMBERG_WHITE,+ padding: '2px 4px',+ fontSize: '9px',+ height: '16px',+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'center',+ fontWeight: activeFilter === item.filter ? 'bold' : 'normal'+ }}>+ <span style={{ color: BLOOMBERG_YELLOW }}>{item.key}:</span>+ <span style={{ marginLeft: '2px' }}>{item.label}</span>+ </button>+ ))}</div></div>- {/* News Articles */}- <div className="flex-1 overflow-y-auto">- <div className="p-4 space-y-4">- {filteredArticles.map((article) => (- <div- key={article.id}- className="bg-gray-900 border border-gray-700 rounded-lg p-4 hover:bg-gray-800 transition-colors"- >- <div className="flex justify-between items-start mb-2">- <div className="flex items-center gap-2">- <span className={`font-semibold ${getSentimentColor(article.sentiment)}`}>- {getSentimentIndicator(article.sentiment)}- </span>- <span className="text-sm font-medium text-orange-400 uppercase">- {article.category}+ {/* Main Content - 3 Panel Layout */}+ <div style={{ flex: 1, overflow: 'auto', padding: '4px', backgroundColor: '#050505' }}>+ <div style={{ display: 'flex', gap: '4px', height: '100%' }}>++ {/* Left Panel - Breaking News Stream */}+ <div style={{+ width: '400px',+ backgroundColor: BLOOMBERG_PANEL_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '4px',+ overflow: 'auto'+ }}>+ <div style={{ color: BLOOMBERG_ORANGE, fontSize: '11px', fontWeight: 'bold', marginBottom: '4px' }}>+ BREAKING NEWS STREAM [{activeFilter}]+ </div>+ <div style={{ borderBottom: `1px solid ${BLOOMBERG_GRAY}`, marginBottom: '4px' }}></div>++ {filteredNews.map((article, index) => (+ <div key={article.id} style={{+ marginBottom: '6px',+ borderLeft: `3px solid ${getPriorityColor(article.priority)}`,+ paddingLeft: '4px',+ backgroundColor: index % 2 === 0 ? 'rgba(255,255,255,0.02)' : 'transparent'+ }}>+ <div style={{ display: 'flex', gap: '4px', marginBottom: '1px', fontSize: '8px' }}>+ <span style={{ color: BLOOMBERG_GRAY, minWidth: '50px' }}>{article.time}</span>+ <span style={{ color: getPriorityColor(article.priority), fontWeight: 'bold', minWidth: '60px' }}>+ [{article.priority}]</span>+ <span style={{ color: BLOOMBERG_BLUE, minWidth: '50px' }}>[{article.category}]</span>+ <span style={{ color: BLOOMBERG_PURPLE, minWidth: '30px' }}>{article.region}</span>+ <span style={{ color: getSentimentColor(article.sentiment), minWidth: '50px' }}>{article.sentiment}</span></div>- <div className="flex items-center gap-2 text-sm text-gray-400">- <span>{article.source}</span>- <span>•</span>- <span>{article.publishedAt}</span>++ <div style={{ color: BLOOMBERG_WHITE, fontWeight: 'bold', fontSize: '10px', lineHeight: '1.2', marginBottom: '2px' }}>+ {article.headline}</div>++ <div style={{ color: BLOOMBERG_GRAY, fontSize: '9px', lineHeight: '1.2', marginBottom: '2px' }}>+ {article.summary}+ </div>++ <div style={{ display: 'flex', justifyContent: 'space-between', fontSize: '8px' }}>+ <span style={{ color: BLOOMBERG_CYAN }}>{article.source}</span>+ <span style={{ color: getImpactColor(article.impact) }}>IMPACT: {article.impact}</span>+ </div>++ <div style={{ fontSize: '8px', marginTop: '1px' }}>+ <span style={{ color: BLOOMBERG_YELLOW }}>TICKERS: </span>+ {article.tickers.map((ticker, i) => (+ <span key={i} style={{ color: BLOOMBERG_GREEN, marginRight: '4px' }}>{ticker}</span>+ ))}+ </div>+ </div>+ ))}+ </div>++ {/* Center Panel - Market Alerts & Analysis */}+ <div style={{+ flex: 1,+ backgroundColor: BLOOMBERG_PANEL_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '4px',+ overflow: 'auto'+ }}>+ <div style={{ color: BLOOMBERG_ORANGE, fontSize: '11px', fontWeight: 'bold', marginBottom: '4px' }}>+ REAL-TIME MARKET ALERTS & ANALYSIS+ </div>+ <div style={{ borderBottom: `1px solid ${BLOOMBERG_GRAY}`, marginBottom: '8px' }}></div>++ {/* Market Alerts Section */}+ <div style={{ marginBottom: '12px' }}>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '10px', fontWeight: 'bold', marginBottom: '4px' }}>+ ACTIVE MARKET ALERTS</div>+ {marketAlerts.map((alert, index) => (+ <div key={index} style={{+ marginBottom: '4px',+ padding: '3px',+ backgroundColor: 'rgba(255,0,0,0.1)',+ border: `1px solid ${getSeverityColor(alert.severity)}`,+ borderRadius: '2px'+ }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', fontSize: '8px', marginBottom: '1px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>{alert.time}</span>+ <span style={{ color: getSeverityColor(alert.severity), fontWeight: 'bold' }}>[{alert.severity}]</span>+ <span style={{ color: BLOOMBERG_BLUE }}>[{alert.type}]</span>+ </div>+ <div style={{ color: BLOOMBERG_WHITE, fontSize: '9px', lineHeight: '1.2', marginBottom: '1px' }}>+ {alert.message}+ </div>+ <div style={{ fontSize: '8px' }}>+ <span style={{ color: BLOOMBERG_YELLOW }}>AFFECTED: </span>+ {alert.affected.map((item, i) => (+ <span key={i} style={{ color: BLOOMBERG_GREEN, marginRight: '4px' }}>{item}</span>+ ))}+ </div>+ </div>+ ))}+ </div>- <h3 className="text-lg font-semibold text-white mb-2 hover:text-orange-400 cursor-pointer">- {article.title}- </h3>+ {/* Market Movers Section */}+ <div style={{ marginBottom: '12px' }}>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '10px', fontWeight: 'bold', marginBottom: '4px' }}>+ TOP MARKET MOVERS - NEWS DRIVEN+ </div>+ <div style={{+ display: 'grid',+ gridTemplateColumns: '1fr 1fr 1fr 1fr',+ gap: '4px',+ fontSize: '9px',+ marginBottom: '4px'+ }}>+ <div style={{ color: BLOOMBERG_WHITE, fontWeight: 'bold' }}>TICKER</div>+ <div style={{ color: BLOOMBERG_WHITE, fontWeight: 'bold' }}>PRICE</div>+ <div style={{ color: BLOOMBERG_WHITE, fontWeight: 'bold' }}>CHANGE</div>+ <div style={{ color: BLOOMBERG_WHITE, fontWeight: 'bold' }}>NEWS IMPACT</div>+ </div>- <p className="text-gray-300 text-sm mb-3 leading-relaxed">- {article.summary}- </p>+ {[+ { ticker: 'AAPL', price: '184.92', change: '+8.34%', impact: 'EARNINGS BEAT' },+ { ticker: 'MSFT', price: '378.45', change: '+6.12%', impact: 'AI REVENUE' },+ { ticker: 'TSLA', price: '251.78', change: '+4.89%', impact: 'DELIVERY BEAT' },+ { ticker: 'XLE', price: '89.23', change: '+4.21%', impact: 'SAUDI CUTS' },+ { ticker: 'BTC', price: '48,567', change: '+12.45%', impact: 'ETF APPROVAL' },+ { ticker: 'JPM', price: '178.34', change: '+3.67%', impact: 'RECORD PROFIT' }+ ].map((stock, index) => (+ <div key={index} style={{+ display: 'grid',+ gridTemplateColumns: '1fr 1fr 1fr 1fr',+ gap: '4px',+ fontSize: '9px',+ marginBottom: '1px',+ backgroundColor: index % 2 === 0 ? 'rgba(255,255,255,0.03)' : 'transparent'+ }}>+ <div style={{ color: BLOOMBERG_WHITE, fontWeight: 'bold' }}>{stock.ticker}</div>+ <div style={{ color: BLOOMBERG_WHITE }}>{stock.price}</div>+ <div style={{ color: BLOOMBERG_GREEN }}>{stock.change}</div>+ <div style={{ color: BLOOMBERG_CYAN }}>{stock.impact}</div>+ </div>+ ))}+ </div>- <div className="flex justify-between items-center">- <div className="flex items-center gap-4">- <span className={`text-sm font-medium ${getSentimentColor(article.sentiment)}`}>- {article.sentiment.toUpperCase()}+ {/* Sector Impact */}+ <div>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '10px', fontWeight: 'bold', marginBottom: '4px' }}>+ NEWS IMPACT BY SECTOR+ </div>+ {[+ { sector: 'Technology', impact: '+4.2%', news: 'AI revenue surge, cloud growth' },+ { sector: 'Energy', impact: '+3.8%', news: 'OPEC cuts, geopolitical tensions' },+ { sector: 'Financials', impact: '+2.9%', news: 'Strong earnings, rate environment' },+ { sector: 'Healthcare', impact: '+1.4%', news: 'FDA approvals, M&A activity' },+ { sector: 'Consumer', impact: '-0.8%', news: 'Inflation concerns, spending data' }+ ].map((sector, index) => (+ <div key={index} style={{+ display: 'flex',+ justifyContent: 'space-between',+ fontSize: '9px',+ marginBottom: '2px',+ padding: '1px 2px'+ }}>+ <span style={{ color: BLOOMBERG_WHITE, minWidth: '80px' }}>{sector.sector}</span>+ <span style={{ color: sector.impact.startsWith('+') ? BLOOMBERG_GREEN : BLOOMBERG_RED, minWidth: '50px' }}>+ {sector.impact}</span>+ <span style={{ color: BLOOMBERG_GRAY, flex: 1, marginLeft: '8px' }}>{sector.news}</span>+ </div>+ ))}+ </div>+ </div>++ {/* Right Panel - News Analytics */}+ <div style={{+ width: '300px',+ backgroundColor: BLOOMBERG_PANEL_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '4px',+ overflow: 'auto'+ }}>+ <div style={{ color: BLOOMBERG_ORANGE, fontSize: '11px', fontWeight: 'bold', marginBottom: '4px' }}>+ NEWS ANALYTICS DASHBOARD+ </div>+ <div style={{ borderBottom: `1px solid ${BLOOMBERG_GRAY}`, marginBottom: '8px' }}></div>++ {/* Sentiment Analysis */}+ <div style={{ marginBottom: '10px' }}>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '10px', fontWeight: 'bold', marginBottom: '4px' }}>+ REAL-TIME SENTIMENT+ </div>+ <div style={{ fontSize: '9px', lineHeight: '1.3' }}>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Bullish Articles:</span>+ <span style={{ color: BLOOMBERG_GREEN }}>162 (62%)</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Bearish Articles:</span>+ <span style={{ color: BLOOMBERG_RED }}>59 (23%)</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Neutral Articles:</span>+ <span style={{ color: BLOOMBERG_YELLOW }}>41 (15%)</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginTop: '2px', paddingTop: '2px', borderTop: `1px solid ${BLOOMBERG_GRAY}` }}>+ <span style={{ color: BLOOMBERG_CYAN }}>Sentiment Score:</span>+ <span style={{ color: BLOOMBERG_GREEN, fontWeight: 'bold' }}>+0.73 (BULLISH)</span></div>- <button className="flex items-center gap-1 text-sm text-orange-400 hover:text-orange-300 transition-colors">- <span>Read More</span>- <ExternalLink size={14} />- </button></div></div>- ))}++ {/* News Flow Statistics */}+ <div style={{ marginBottom: '10px' }}>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '10px', fontWeight: 'bold', marginBottom: '4px' }}>+ NEWS FLOW STATISTICS+ </div>+ <div style={{ fontSize: '9px', lineHeight: '1.3' }}>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Articles Today:</span>+ <span style={{ color: BLOOMBERG_WHITE }}>2,847</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Breaking News:</span>+ <span style={{ color: BLOOMBERG_RED }}>23</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Earnings Reports:</span>+ <span style={{ color: BLOOMBERG_BLUE }}>78</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Economic Data:</span>+ <span style={{ color: BLOOMBERG_PURPLE }}>12</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Fed News:</span>+ <span style={{ color: BLOOMBERG_ORANGE }}>8</span>+ </div>+ </div>+ </div>++ {/* Trending Topics */}+ <div style={{ marginBottom: '10px' }}>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '10px', fontWeight: 'bold', marginBottom: '4px' }}>+ TRENDING TOPICS (1H)+ </div>+ <div style={{ fontSize: '9px' }}>+ {[+ { topic: 'Federal Reserve', mentions: 156, trend: 'up' },+ { topic: 'Artificial Intelligence', mentions: 134, trend: 'up' },+ { topic: 'Bitcoin ETF', mentions: 89, trend: 'up' },+ { topic: 'Oil Prices', mentions: 67, trend: 'up' },+ { topic: 'Bank Earnings', mentions: 45, trend: 'stable' },+ { topic: 'China Economy', mentions: 38, trend: 'down' }+ ].map((item, index) => (+ <div key={index} style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '1px' }}>+ <span style={{ color: BLOOMBERG_WHITE }}>{item.topic}</span>+ <div style={{ display: 'flex', gap: '4px', alignItems: 'center' }}>+ <span style={{ color: BLOOMBERG_CYAN }}>{item.mentions}</span>+ <span style={{+ color: item.trend === 'up' ? BLOOMBERG_GREEN :+ item.trend === 'down' ? BLOOMBERG_RED : BLOOMBERG_YELLOW+ }}>+ {item.trend === 'up' ? '↑' : item.trend === 'down' ? '↓' : '→'}+ </span>+ </div>+ </div>+ ))}+ </div>+ </div>++ {/* Key Economic Events */}+ <div>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '10px', fontWeight: 'bold', marginBottom: '4px' }}>+ UPCOMING EVENTS+ </div>+ <div style={{ fontSize: '8px' }}>+ {[+ { time: '18:00', event: 'Fed Chair Powell Speech', impact: 'HIGH' },+ { time: '22:30', event: 'Core PCE Data Release', impact: 'HIGH' },+ { time: 'Thu 08:30', event: 'Initial Jobless Claims', impact: 'MEDIUM' },+ { time: 'Thu 10:00', event: 'ISM Manufacturing PMI', impact: 'MEDIUM' },+ { time: 'Fri 08:30', event: 'Non-Farm Payrolls', impact: 'HIGH' }+ ].map((event, index) => (+ <div key={index} style={{ marginBottom: '2px', display: 'flex', gap: '4px' }}>+ <span style={{ color: BLOOMBERG_GRAY, minWidth: '55px' }}>{event.time}</span>+ <span style={{ color: BLOOMBERG_WHITE, flex: 1 }}>{event.event}</span>+ <span style={{ color: getImpactColor(event.impact), minWidth: '40px' }}>[{event.impact}]</span>+ </div>+ ))}+ </div>+ </div>+ </div></div></div>- {/* Footer */}- <div className="bg-gray-900 border-t border-gray-700 p-3">- <div className="flex justify-between items-center text-sm">- <div className="text-gray-400">- News sources: Reuters, Bloomberg, WSJ, FT, CNBC, MarketWatch, AP+ {/* Status Bar */}+ <div style={{+ borderTop: `1px solid ${BLOOMBERG_GRAY}`,+ backgroundColor: BLOOMBERG_PANEL_BG,+ padding: '2px 8px',+ fontSize: '10px',+ color: BLOOMBERG_GRAY,+ flexShrink: 0+ }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>+ <div style={{ display: 'flex', gap: '16px' }}>+ <span>Bloomberg News Terminal v4.1.2 | Real-time financial news analysis</span>+ <span>Sources: 47 Active | Processing: 2.3M articles/day | Sentiment: +0.73 Bullish</span></div>- <div className="text-gray-400">- Auto-refresh: 30s+ <div style={{ display: 'flex', gap: '16px' }}>+ <span>Alerts: {alertCount} | Updates: {newsTicker}</span>+ <span>Session: {currentTime.toTimeString().substring(0, 8)}</span>+ <span style={{ color: BLOOMBERG_GREEN }}>FEED: LIVE</span></div></div></div>++ {/* CSS for animations */}+ <style>{`+ @keyframes scroll-left {+ 0% { transform: translateX(100%); }+ 100% { transform: translateX(-100%); }+ }+ @keyframes blink {+ 0%, 50% { opacity: 1; }+ 51%, 100% { opacity: 0.3; }+ }+ `}</style></div>);};diff --git a/fincept-terminal-desktop/src/components/tabs/OptionsTab.tsx b/fincept-terminal-desktop/src/components/tabs/OptionsTab.tsxnew file mode 100644index 000000000..3135d41a6--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/OptionsTab.tsx@@ -0,0 +1,546 @@+import React, { useState, useEffect } from 'react';++interface OptionContract {+ strike: number;+ callBid: number;+ callAsk: number;+ callLast: number;+ callVolume: number;+ callOI: number;+ callIV: number;+ callDelta: number;+ callGamma: number;+ callTheta: number;+ callVega: number;+ putBid: number;+ putAsk: number;+ putLast: number;+ putVolume: number;+ putOI: number;+ putIV: number;+ putDelta: number;+ putGamma: number;+ putTheta: number;+ putVega: number;+}++const OptionsTab: React.FC = () => {+ const [currentTime, setCurrentTime] = useState(new Date());+ const [selectedSymbol, setSelectedSymbol] = useState('AAPL');+ const [selectedExpiry, setSelectedExpiry] = useState('2025-03-21');+ const [showGreeks, setShowGreeks] = useState(true);++ const COLOR_ORANGE = '#FFA500';+ const COLOR_WHITE = '#FFFFFF';+ const COLOR_RED = '#FF0000';+ const COLOR_GREEN = '#00C800';+ const COLOR_YELLOW = '#FFFF00';+ const COLOR_GRAY = '#787878';+ const COLOR_BLUE = '#6496FA';+ const COLOR_PURPLE = '#C864FF';+ const COLOR_CYAN = '#00FFFF';+ const COLOR_DARK_BG = '#000000';+ const COLOR_PANEL_BG = '#0a0a0a';++ useEffect(() => {+ const timer = setInterval(() => setCurrentTime(new Date()), 1000);+ return () => clearInterval(timer);+ }, []);++ const underlyingPrice = 178.45;+ const symbols = ['AAPL', 'MSFT', 'GOOGL', 'AMZN', 'TSLA', 'NVDA', 'META', 'SPY', 'QQQ'];+ const expiryDates = ['2025-03-21', '2025-04-18', '2025-05-16', '2025-06-20', '2025-09-19', '2025-12-19'];++ const optionsChain: OptionContract[] = [+ {+ strike: 170,+ callBid: 9.80, callAsk: 10.10, callLast: 9.95, callVolume: 1245, callOI: 8934,+ callIV: 0.284, callDelta: 0.78, callGamma: 0.042, callTheta: -0.089, callVega: 0.156,+ putBid: 1.35, putAsk: 1.42, putLast: 1.38, putVolume: 892, putOI: 5623,+ putIV: 0.298, putDelta: -0.22, putGamma: 0.042, putTheta: -0.067, putVega: 0.156+ },+ {+ strike: 172.50,+ callBid: 7.90, callAsk: 8.15, callLast: 8.05, callVolume: 2134, callOI: 12456,+ callIV: 0.276, callDelta: 0.72, callGamma: 0.048, callTheta: -0.094, callVega: 0.167,+ putBid: 1.75, putAsk: 1.83, putLast: 1.79, putVolume: 1456, putOI: 8234,+ putIV: 0.291, putDelta: -0.28, putGamma: 0.048, putTheta: -0.072, putVega: 0.167+ },+ {+ strike: 175,+ callBid: 6.20, callAsk: 6.45, callLast: 6.35, callVolume: 3456, callOI: 18934,+ callIV: 0.268, callDelta: 0.65, callGamma: 0.054, callTheta: -0.101, callVega: 0.178,+ putBid: 2.30, putAsk: 2.40, putLast: 2.35, putVolume: 2234, putOI: 11234,+ putIV: 0.284, putDelta: -0.35, putGamma: 0.054, putTheta: -0.078, putVega: 0.178+ },+ {+ strike: 177.50,+ callBid: 4.70, callAsk: 4.90, callLast: 4.82, callVolume: 5678, callOI: 23456,+ callIV: 0.261, callDelta: 0.56, callGamma: 0.059, callTheta: -0.108, callVega: 0.189,+ putBid: 3.05, putAsk: 3.18, putLast: 3.12, putVolume: 3456, putOI: 15678,+ putIV: 0.278, putDelta: -0.44, putGamma: 0.059, putTheta: -0.085, putVega: 0.189+ },+ {+ strike: 180,+ callBid: 3.45, callAsk: 3.62, callLast: 3.55, callVolume: 8923, callOI: 34567,+ callIV: 0.255, callDelta: 0.47, callGamma: 0.062, callTheta: -0.114, callVega: 0.198,+ putBid: 4.10, putAsk: 4.28, putLast: 4.20, putVolume: 5678, putOI: 22345,+ putIV: 0.272, putDelta: -0.53, putGamma: 0.062, putTheta: -0.092, putVega: 0.198+ },+ {+ strike: 182.50,+ callBid: 2.45, callAsk: 2.58, callLast: 2.52, callVolume: 6789, callOI: 28934,+ callIV: 0.249, callDelta: 0.38, callGamma: 0.063, callTheta: -0.118, callVega: 0.205,+ putBid: 5.45, putAsk: 5.68, putLast: 5.58, putVolume: 4567, putOI: 19234,+ putIV: 0.267, putDelta: -0.62, putGamma: 0.063, putTheta: -0.098, putVega: 0.205+ },+ {+ strike: 185,+ callBid: 1.68, callAsk: 1.78, callLast: 1.73, callVolume: 4567, callOI: 21234,+ callIV: 0.244, callDelta: 0.29, callGamma: 0.059, callTheta: -0.120, callVega: 0.209,+ putBid: 7.20, putAsk: 7.48, putLast: 7.35, putVolume: 3234, putOI: 16789,+ putIV: 0.263, putDelta: -0.71, putGamma: 0.059, putTheta: -0.103, putVega: 0.209+ },+ {+ strike: 187.50,+ callBid: 1.12, callAsk: 1.20, callLast: 1.16, callVolume: 2345, callOI: 14567,+ callIV: 0.240, callDelta: 0.21, callGamma: 0.052, callTheta: -0.119, callVega: 0.210,+ putBid: 9.35, putAsk: 9.68, putLast: 9.52, putVolume: 1892, putOI: 12456,+ putIV: 0.259, putDelta: -0.79, putGamma: 0.052, putTheta: -0.106, putVega: 0.210+ }+ ];++ const volatilitySurface = [+ { expiry: '1M', atm: 0.255, skew: -0.012 },+ { expiry: '2M', atm: 0.268, skew: -0.015 },+ { expiry: '3M', atm: 0.281, skew: -0.018 },+ { expiry: '6M', atm: 0.302, skew: -0.022 },+ { expiry: '1Y', atm: 0.334, skew: -0.028 }+ ];++ const portfolioGreeks = {+ totalDelta: 245.67,+ totalGamma: 12.34,+ totalTheta: -89.23,+ totalVega: 456.78,+ totalRho: 34.56+ };++ return (+ <div style={{+ height: '100%',+ backgroundColor: COLOR_DARK_BG,+ color: COLOR_WHITE,+ fontFamily: 'Consolas, monospace',+ overflow: 'hidden',+ display: 'flex',+ flexDirection: 'column',+ fontSize: '12px'+ }}>+ {/* Header */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ borderBottom: `2px solid ${COLOR_GRAY}`,+ padding: '8px 16px',+ flexShrink: 0+ }}>+ <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>+ <span style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '16px' }}>+ OPTIONS CHAIN+ </span>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <div style={{ display: 'flex', gap: '8px', alignItems: 'center' }}>+ <span style={{ color: COLOR_GRAY, fontSize: '11px' }}>SYMBOL:</span>+ <select+ value={selectedSymbol}+ onChange={(e) => setSelectedSymbol(e.target.value)}+ style={{+ backgroundColor: COLOR_DARK_BG,+ color: COLOR_CYAN,+ border: `2px solid ${COLOR_GRAY}`,+ padding: '4px 8px',+ fontSize: '11px',+ fontFamily: 'Consolas, monospace',+ fontWeight: 'bold'+ }}>+ {symbols.map(sym => (+ <option key={sym} value={sym}>{sym}</option>+ ))}+ </select>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <span style={{ color: COLOR_GREEN, fontSize: '14px', fontWeight: 'bold' }}>+ ${underlyingPrice.toFixed(2)}+ </span>+ </div>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <div style={{ display: 'flex', gap: '8px', alignItems: 'center' }}>+ <span style={{ color: COLOR_GRAY, fontSize: '11px' }}>EXPIRY:</span>+ <select+ value={selectedExpiry}+ onChange={(e) => setSelectedExpiry(e.target.value)}+ style={{+ backgroundColor: COLOR_DARK_BG,+ color: COLOR_YELLOW,+ border: `2px solid ${COLOR_GRAY}`,+ padding: '4px 8px',+ fontSize: '11px',+ fontFamily: 'Consolas, monospace',+ fontWeight: 'bold'+ }}>+ {expiryDates.map(date => (+ <option key={date} value={date}>{date}</option>+ ))}+ </select>+ </div>+ </div>+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>+ <button+ onClick={() => setShowGreeks(!showGreeks)}+ style={{+ padding: '6px 12px',+ backgroundColor: showGreeks ? COLOR_ORANGE : COLOR_DARK_BG,+ border: `2px solid ${COLOR_ORANGE}`,+ color: showGreeks ? COLOR_DARK_BG : COLOR_ORANGE,+ fontSize: '10px',+ fontWeight: 'bold',+ cursor: 'pointer',+ fontFamily: 'Consolas, monospace'+ }}>+ {showGreeks ? 'HIDE GREEKS' : 'SHOW GREEKS'}+ </button>+ <span style={{ color: COLOR_GRAY, fontSize: '11px' }}>+ {currentTime.toLocaleTimeString()}+ </span>+ </div>+ </div>+ </div>++ {/* Main Content */}+ <div style={{ flex: 1, overflow: 'auto', display: 'flex', gap: '12px', padding: '12px' }}>+ {/* Left Panel - Greeks & IV */}+ <div style={{ width: '280px', display: 'flex', flexDirection: 'column', gap: '12px' }}>+ {/* Portfolio Greeks */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ border: `2px solid ${COLOR_GRAY}`,+ borderLeft: `6px solid ${COLOR_GREEN}`,+ padding: '12px'+ }}>+ <div style={{ color: COLOR_ORANGE, fontSize: '13px', fontWeight: 'bold', marginBottom: '12px' }}>+ PORTFOLIO GREEKS+ </div>+ <div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>+ <div style={{+ padding: '8px',+ backgroundColor: 'rgba(0,200,0,0.05)',+ border: `1px solid ${COLOR_GREEN}`+ }}>+ <div style={{ color: COLOR_GRAY, fontSize: '10px', marginBottom: '2px' }}>DELTA</div>+ <div style={{ color: COLOR_GREEN, fontSize: '16px', fontWeight: 'bold' }}>+ {portfolioGreeks.totalDelta.toFixed(2)}+ </div>+ <div style={{ color: COLOR_GRAY, fontSize: '9px' }}>Directional exposure</div>+ </div>+ <div style={{+ padding: '8px',+ backgroundColor: 'rgba(100,150,250,0.05)',+ border: `1px solid ${COLOR_BLUE}`+ }}>+ <div style={{ color: COLOR_GRAY, fontSize: '10px', marginBottom: '2px' }}>GAMMA</div>+ <div style={{ color: COLOR_BLUE, fontSize: '16px', fontWeight: 'bold' }}>+ {portfolioGreeks.totalGamma.toFixed(2)}+ </div>+ <div style={{ color: COLOR_GRAY, fontSize: '9px' }}>Delta sensitivity</div>+ </div>+ <div style={{+ padding: '8px',+ backgroundColor: 'rgba(255,0,0,0.05)',+ border: `1px solid ${COLOR_RED}`+ }}>+ <div style={{ color: COLOR_GRAY, fontSize: '10px', marginBottom: '2px' }}>THETA</div>+ <div style={{ color: COLOR_RED, fontSize: '16px', fontWeight: 'bold' }}>+ {portfolioGreeks.totalTheta.toFixed(2)}+ </div>+ <div style={{ color: COLOR_GRAY, fontSize: '9px' }}>Time decay (per day)</div>+ </div>+ <div style={{+ padding: '8px',+ backgroundColor: 'rgba(200,100,255,0.05)',+ border: `1px solid ${COLOR_PURPLE}`+ }}>+ <div style={{ color: COLOR_GRAY, fontSize: '10px', marginBottom: '2px' }}>VEGA</div>+ <div style={{ color: COLOR_PURPLE, fontSize: '16px', fontWeight: 'bold' }}>+ {portfolioGreeks.totalVega.toFixed(2)}+ </div>+ <div style={{ color: COLOR_GRAY, fontSize: '9px' }}>Volatility exposure</div>+ </div>+ </div>+ </div>++ {/* Volatility Surface */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ border: `2px solid ${COLOR_GRAY}`,+ borderLeft: `6px solid ${COLOR_PURPLE}`,+ padding: '12px'+ }}>+ <div style={{ color: COLOR_ORANGE, fontSize: '13px', fontWeight: 'bold', marginBottom: '12px' }}>+ IMPLIED VOLATILITY+ </div>+ <div style={{ display: 'flex', flexDirection: 'column', gap: '6px' }}>+ {volatilitySurface.map((vol, index) => (+ <div key={index} style={{+ padding: '8px',+ backgroundColor: index % 2 === 0 ? 'rgba(255,255,255,0.02)' : 'transparent',+ borderBottom: `1px solid ${COLOR_GRAY}`+ }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '4px' }}>+ <span style={{ color: COLOR_GRAY, fontSize: '11px' }}>{vol.expiry}</span>+ <span style={{ color: COLOR_PURPLE, fontSize: '12px', fontWeight: 'bold' }}>+ {(vol.atm * 100).toFixed(1)}%+ </span>+ </div>+ <div style={{ fontSize: '9px', color: vol.skew < 0 ? COLOR_RED : COLOR_GREEN }}>+ Skew: {(vol.skew * 100).toFixed(2)}%+ </div>+ </div>+ ))}+ </div>+ </div>++ {/* Quick Stats */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ border: `2px solid ${COLOR_GRAY}`,+ borderLeft: `6px solid ${COLOR_CYAN}`,+ padding: '12px'+ }}>+ <div style={{ color: COLOR_ORANGE, fontSize: '13px', fontWeight: 'bold', marginBottom: '12px' }}>+ QUICK STATS+ </div>+ <div style={{ display: 'flex', flexDirection: 'column', gap: '6px', fontSize: '11px' }}>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: COLOR_GRAY }}>Total Call Vol:</span>+ <span style={{ color: COLOR_GREEN, fontWeight: 'bold' }}>35,198</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: COLOR_GRAY }}>Total Put Vol:</span>+ <span style={{ color: COLOR_RED, fontWeight: 'bold' }}>23,409</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: COLOR_GRAY }}>Put/Call Ratio:</span>+ <span style={{ color: COLOR_YELLOW, fontWeight: 'bold' }}>0.67</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: COLOR_GRAY }}>Max Pain:</span>+ <span style={{ color: COLOR_CYAN, fontWeight: 'bold' }}>$177.50</span>+ </div>+ </div>+ </div>+ </div>++ {/* Right Panel - Options Chain */}+ <div style={{ flex: 1, display: 'flex', flexDirection: 'column' }}>+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ border: `2px solid ${COLOR_GRAY}`,+ flex: 1,+ overflow: 'auto'+ }}>+ {/* Table Header */}+ <div style={{+ display: 'grid',+ gridTemplateColumns: showGreeks+ ? '80px 70px 70px 70px 80px 60px 60px 60px 60px 60px 80px 70px 70px 70px 80px 60px 60px 60px 60px 60px'+ : '100px 80px 80px 80px 100px 80px 100px 80px 80px 80px 100px 80px',+ padding: '10px 12px',+ backgroundColor: 'rgba(255,165,0,0.1)',+ borderBottom: `2px solid ${COLOR_ORANGE}`,+ position: 'sticky',+ top: 0,+ zIndex: 10,+ fontSize: '9px'+ }}>+ {showGreeks ? (+ <>+ {/* Calls */}+ <div style={{ color: COLOR_GREEN, fontWeight: 'bold', textAlign: 'center' }} colSpan={10}>+ ========== CALLS ==========+ </div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold', textAlign: 'center' }}>STRIKE</div>+ {/* Puts */}+ <div style={{ color: COLOR_RED, fontWeight: 'bold', textAlign: 'center' }} colSpan={10}>+ ========== PUTS ==========+ </div>+ </>+ ) : (+ <>+ <div style={{ color: COLOR_GREEN, fontWeight: 'bold' }}>C.BID</div>+ <div style={{ color: COLOR_GREEN, fontWeight: 'bold' }}>C.ASK</div>+ <div style={{ color: COLOR_GREEN, fontWeight: 'bold' }}>C.LAST</div>+ <div style={{ color: COLOR_GREEN, fontWeight: 'bold' }}>C.VOL</div>+ <div style={{ color: COLOR_GREEN, fontWeight: 'bold' }}>C.OI</div>+ <div style={{ color: COLOR_GREEN, fontWeight: 'bold' }}>C.IV</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold' }}>STRIKE</div>+ <div style={{ color: COLOR_RED, fontWeight: 'bold' }}>P.BID</div>+ <div style={{ color: COLOR_RED, fontWeight: 'bold' }}>P.ASK</div>+ <div style={{ color: COLOR_RED, fontWeight: 'bold' }}>P.LAST</div>+ <div style={{ color: COLOR_RED, fontWeight: 'bold' }}>P.VOL</div>+ <div style={{ color: COLOR_RED, fontWeight: 'bold' }}>P.OI</div>+ <div style={{ color: COLOR_RED, fontWeight: 'bold' }}>P.IV</div>+ </>+ )}+ </div>++ {showGreeks && (+ <div style={{+ display: 'grid',+ gridTemplateColumns: '80px 70px 70px 70px 80px 60px 60px 60px 60px 60px 80px 70px 70px 70px 80px 60px 60px 60px 60px 60px',+ padding: '8px 12px',+ backgroundColor: COLOR_PANEL_BG,+ borderBottom: `1px solid ${COLOR_GRAY}`,+ position: 'sticky',+ top: '32px',+ zIndex: 9,+ fontSize: '9px'+ }}>+ <div style={{ color: COLOR_GREEN, fontWeight: 'bold' }}>BID</div>+ <div style={{ color: COLOR_GREEN, fontWeight: 'bold' }}>ASK</div>+ <div style={{ color: COLOR_GREEN, fontWeight: 'bold' }}>LAST</div>+ <div style={{ color: COLOR_GREEN, fontWeight: 'bold' }}>VOL</div>+ <div style={{ color: COLOR_GREEN, fontWeight: 'bold' }}>OI</div>+ <div style={{ color: COLOR_GREEN, fontWeight: 'bold' }}>IV</div>+ <div style={{ color: COLOR_GREEN, fontWeight: 'bold' }}>Δ</div>+ <div style={{ color: COLOR_GREEN, fontWeight: 'bold' }}>Γ</div>+ <div style={{ color: COLOR_GREEN, fontWeight: 'bold' }}>Θ</div>+ <div style={{ color: COLOR_GREEN, fontWeight: 'bold' }}>V</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold' }}>STRIKE</div>+ <div style={{ color: COLOR_RED, fontWeight: 'bold' }}>BID</div>+ <div style={{ color: COLOR_RED, fontWeight: 'bold' }}>ASK</div>+ <div style={{ color: COLOR_RED, fontWeight: 'bold' }}>LAST</div>+ <div style={{ color: COLOR_RED, fontWeight: 'bold' }}>VOL</div>+ <div style={{ color: COLOR_RED, fontWeight: 'bold' }}>OI</div>+ <div style={{ color: COLOR_RED, fontWeight: 'bold' }}>IV</div>+ <div style={{ color: COLOR_RED, fontWeight: 'bold' }}>Δ</div>+ <div style={{ color: COLOR_RED, fontWeight: 'bold' }}>Γ</div>+ <div style={{ color: COLOR_RED, fontWeight: 'bold' }}>Θ</div>+ <div style={{ color: COLOR_RED, fontWeight: 'bold' }}>V</div>+ </div>+ )}++ {/* Table Body */}+ {optionsChain.map((option, index) => {+ const isITM = option.strike < underlyingPrice;+ const isATM = Math.abs(option.strike - underlyingPrice) < 2.5;++ return (+ <div key={index}+ style={{+ display: 'grid',+ gridTemplateColumns: showGreeks+ ? '80px 70px 70px 70px 80px 60px 60px 60px 60px 60px 80px 70px 70px 70px 80px 60px 60px 60px 60px 60px'+ : '100px 80px 80px 80px 100px 80px 100px 80px 80px 80px 100px 80px',+ padding: '8px 12px',+ backgroundColor: isATM ? 'rgba(255,165,0,0.1)' : (index % 2 === 0 ? 'rgba(255,255,255,0.02)' : 'transparent'),+ borderBottom: `1px solid ${COLOR_GRAY}`,+ fontSize: '10px'+ }}>+ {/* Calls */}+ <div style={{ color: COLOR_GREEN }}>${option.callBid.toFixed(2)}</div>+ <div style={{ color: COLOR_GREEN }}>${option.callAsk.toFixed(2)}</div>+ <div style={{ color: COLOR_WHITE, fontWeight: 'bold' }}>${option.callLast.toFixed(2)}</div>+ <div style={{ color: COLOR_CYAN }}>{option.callVolume.toLocaleString()}</div>+ <div style={{ color: COLOR_GRAY }}>{option.callOI.toLocaleString()}</div>+ <div style={{ color: COLOR_PURPLE }}>{(option.callIV * 100).toFixed(1)}%</div>+ {showGreeks && (+ <>+ <div style={{ color: COLOR_GREEN }}>{option.callDelta.toFixed(2)}</div>+ <div style={{ color: COLOR_BLUE }}>{option.callGamma.toFixed(3)}</div>+ <div style={{ color: COLOR_RED }}>{option.callTheta.toFixed(3)}</div>+ <div style={{ color: COLOR_PURPLE }}>{option.callVega.toFixed(3)}</div>+ </>+ )}++ {/* Strike */}+ <div style={{+ color: isATM ? COLOR_ORANGE : COLOR_WHITE,+ fontWeight: isATM ? 'bold' : 'normal',+ fontSize: isATM ? '12px' : '10px',+ textAlign: 'center',+ backgroundColor: isATM ? 'rgba(255,165,0,0.2)' : 'transparent',+ padding: '4px'+ }}>+ ${option.strike.toFixed(2)}+ </div>++ {/* Puts */}+ <div style={{ color: COLOR_RED }}>${option.putBid.toFixed(2)}</div>+ <div style={{ color: COLOR_RED }}>${option.putAsk.toFixed(2)}</div>+ <div style={{ color: COLOR_WHITE, fontWeight: 'bold' }}>${option.putLast.toFixed(2)}</div>+ <div style={{ color: COLOR_CYAN }}>{option.putVolume.toLocaleString()}</div>+ <div style={{ color: COLOR_GRAY }}>{option.putOI.toLocaleString()}</div>+ <div style={{ color: COLOR_PURPLE }}>{(option.putIV * 100).toFixed(1)}%</div>+ {showGreeks && (+ <>+ <div style={{ color: COLOR_RED }}>{option.putDelta.toFixed(2)}</div>+ <div style={{ color: COLOR_BLUE }}>{option.putGamma.toFixed(3)}</div>+ <div style={{ color: COLOR_RED }}>{option.putTheta.toFixed(3)}</div>+ <div style={{ color: COLOR_PURPLE }}>{option.putVega.toFixed(3)}</div>+ </>+ )}+ </div>+ );+ })}+ </div>+ </div>+ </div>++ {/* Footer */}+ <div style={{+ borderTop: `3px solid ${COLOR_ORANGE}`,+ backgroundColor: COLOR_PANEL_BG,+ padding: '12px 16px',+ fontSize: '11px',+ color: COLOR_WHITE,+ flexShrink: 0+ }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '8px' }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '16px' }}>+ <span style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '13px' }}>+ OPTIONS ANALYTICS v1.0+ </span>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <span style={{ color: COLOR_CYAN }}>+ Real-time options chain with Greeks+ </span>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <span style={{ color: COLOR_GREEN }}>+ {selectedSymbol} • Exp: {selectedExpiry}+ </span>+ </div>+ </div>+ <div style={{+ display: 'flex',+ justifyContent: 'space-between',+ fontSize: '10px',+ paddingTop: '8px',+ borderTop: `1px solid ${COLOR_GRAY}`+ }}>+ <div style={{ display: 'flex', gap: '16px' }}>+ <span style={{ color: COLOR_GRAY }}><span style={{ color: COLOR_BLUE }}>F1</span> Help</span>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <span style={{ color: COLOR_GRAY }}><span style={{ color: COLOR_BLUE }}>F2</span> Strategy Builder</span>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <span style={{ color: COLOR_GRAY }}><span style={{ color: COLOR_BLUE }}>F3</span> Risk Analysis</span>+ </div>+ <div style={{ color: COLOR_GRAY }}>+ © 2025 Fincept Labs • All Rights Reserved+ </div>+ </div>+ </div>+ </div>+ );+};++export default OptionsTab;\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/tabs/PortfolioTab.tsx b/fincept-terminal-desktop/src/components/tabs/PortfolioTab.tsxnew file mode 100644index 000000000..b61d7660d--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/PortfolioTab.tsx@@ -0,0 +1,612 @@+import React, { useState, useEffect } from 'react';++interface Position {+ ticker: string;+ name: string;+ quantity: number;+ avgPrice: number;+ currentPrice: number;+ marketValue: number;+ costBasis: number;+ unrealizedPnL: number;+ unrealizedPnLPercent: number;+ dayChange: number;+ dayChangePercent: number;+ weight: number;+ sector: string;+}++const PortfolioTab: React.FC = () => {+ const [currentTime, setCurrentTime] = useState(new Date());+ const [selectedView, setSelectedView] = useState('POSITIONS');+ const [sortBy, setSortBy] = useState('WEIGHT');++ // Bloomberg color scheme+ const BLOOMBERG_ORANGE = '#FFA500';+ const BLOOMBERG_WHITE = '#FFFFFF';+ const BLOOMBERG_RED = '#FF0000';+ const BLOOMBERG_GREEN = '#00C800';+ const BLOOMBERG_YELLOW = '#FFFF00';+ const BLOOMBERG_GRAY = '#787878';+ const BLOOMBERG_BLUE = '#6496FA';+ const BLOOMBERG_PURPLE = '#C864FF';+ const BLOOMBERG_CYAN = '#00FFFF';+ const BLOOMBERG_DARK_BG = '#000000';+ const BLOOMBERG_PANEL_BG = '#0a0a0a';++ useEffect(() => {+ const timer = setInterval(() => {+ setCurrentTime(new Date());+ }, 1000);+ return () => clearInterval(timer);+ }, []);++ const positions: Position[] = [+ {+ ticker: 'AAPL',+ name: 'Apple Inc.',+ quantity: 250,+ avgPrice: 165.50,+ currentPrice: 184.92,+ marketValue: 46230.00,+ costBasis: 41375.00,+ unrealizedPnL: 4855.00,+ unrealizedPnLPercent: 11.73,+ dayChange: 462.30,+ dayChangePercent: 1.01,+ weight: 28.5,+ sector: 'Technology'+ },+ {+ ticker: 'MSFT',+ name: 'Microsoft Corporation',+ quantity: 120,+ avgPrice: 340.00,+ currentPrice: 378.45,+ marketValue: 45414.00,+ costBasis: 40800.00,+ unrealizedPnL: 4614.00,+ unrealizedPnLPercent: 11.31,+ dayChange: 454.14,+ dayChangePercent: 1.01,+ weight: 28.0,+ sector: 'Technology'+ },+ {+ ticker: 'NVDA',+ name: 'NVIDIA Corporation',+ quantity: 75,+ avgPrice: 450.00,+ currentPrice: 501.23,+ marketValue: 37592.25,+ costBasis: 33750.00,+ unrealizedPnL: 3842.25,+ unrealizedPnLPercent: 11.39,+ dayChange: 375.92,+ dayChangePercent: 1.01,+ weight: 23.2,+ sector: 'Semiconductors'+ },+ {+ ticker: 'GOOGL',+ name: 'Alphabet Inc.',+ quantity: 150,+ avgPrice: 125.00,+ currentPrice: 134.56,+ marketValue: 20184.00,+ costBasis: 18750.00,+ unrealizedPnL: 1434.00,+ unrealizedPnLPercent: 7.65,+ dayChange: 201.84,+ dayChangePercent: 1.01,+ weight: 12.4,+ sector: 'Technology'+ },+ {+ ticker: 'TSLA',+ name: 'Tesla Inc.',+ quantity: 50,+ avgPrice: 225.00,+ currentPrice: 251.78,+ marketValue: 12589.00,+ costBasis: 11250.00,+ unrealizedPnL: 1339.00,+ unrealizedPnLPercent: 11.90,+ dayChange: 125.89,+ dayChangePercent: 1.01,+ weight: 7.8,+ sector: 'Automotive'+ }+ ];++ const totalMarketValue = positions.reduce((sum, pos) => sum + pos.marketValue, 0);+ const totalCostBasis = positions.reduce((sum, pos) => sum + pos.costBasis, 0);+ const totalUnrealizedPnL = totalMarketValue - totalCostBasis;+ const totalUnrealizedPnLPercent = (totalUnrealizedPnL / totalCostBasis) * 100;+ const totalDayChange = positions.reduce((sum, pos) => sum + pos.dayChange, 0);+ const totalDayChangePercent = (totalDayChange / (totalMarketValue - totalDayChange)) * 100;++ const sectorAllocation = positions.reduce((acc, pos) => {+ if (!acc[pos.sector]) {+ acc[pos.sector] = { value: 0, weight: 0 };+ }+ acc[pos.sector].value += pos.marketValue;+ acc[pos.sector].weight += pos.weight;+ return acc;+ }, {} as Record<string, { value: number; weight: number }>);++ const performanceMetrics = [+ { label: 'YTD Return', value: '+18.45%', color: BLOOMBERG_GREEN },+ { label: '1M Return', value: '+5.23%', color: BLOOMBERG_GREEN },+ { label: '3M Return', value: '+12.67%', color: BLOOMBERG_GREEN },+ { label: '1Y Return', value: '+34.89%', color: BLOOMBERG_GREEN },+ { label: 'Sharpe Ratio', value: '1.87', color: BLOOMBERG_CYAN },+ { label: 'Beta', value: '1.12', color: BLOOMBERG_CYAN },+ { label: 'Max Drawdown', value: '-8.23%', color: BLOOMBERG_RED },+ { label: 'Volatility', value: '18.5%', color: BLOOMBERG_YELLOW }+ ];++ const recentTransactions = [+ { date: '2024-01-22', ticker: 'AAPL', type: 'BUY', quantity: 50, price: 182.50, total: 9125.00 },+ { date: '2024-01-20', ticker: 'NVDA', type: 'BUY', quantity: 25, price: 495.00, total: 12375.00 },+ { date: '2024-01-18', ticker: 'GOOGL', type: 'SELL', quantity: 30, price: 138.20, total: 4146.00 },+ { date: '2024-01-15', ticker: 'MSFT', type: 'BUY', quantity: 40, price: 365.00, total: 14600.00 }+ ];++ return (+ <div style={{+ height: '100%',+ backgroundColor: BLOOMBERG_DARK_BG,+ color: BLOOMBERG_WHITE,+ fontFamily: 'Consolas, monospace',+ overflow: 'hidden',+ display: 'flex',+ flexDirection: 'column',+ fontSize: '12px'+ }}>+ {/* Header */}+ <div style={{+ backgroundColor: BLOOMBERG_PANEL_BG,+ borderBottom: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '4px 8px',+ flexShrink: 0+ }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px', fontSize: '13px', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_ORANGE, fontWeight: 'bold' }}>FINCEPT PORTFOLIO MANAGER</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_GREEN }}>● LIVE TRACKING</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_CYAN }}>POSITIONS: {positions.length}</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_YELLOW }}>TOTAL VALUE: ${totalMarketValue.toLocaleString(undefined, {minimumFractionDigits: 2})}</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_WHITE }}>{currentTime.toISOString().replace('T', ' ').substring(0, 19)} UTC</span>+ </div>++ <div style={{ display: 'flex', alignItems: 'center', gap: '8px', fontSize: '11px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>DAY P&L:</span>+ <span style={{ color: totalDayChange >= 0 ? BLOOMBERG_GREEN : BLOOMBERG_RED }}>+ ${totalDayChange >= 0 ? '+' : ''}{totalDayChange.toFixed(2)} ({totalDayChangePercent >= 0 ? '+' : ''}{totalDayChangePercent.toFixed(2)}%)+ </span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_GRAY }}>TOTAL P&L:</span>+ <span style={{ color: totalUnrealizedPnL >= 0 ? BLOOMBERG_GREEN : BLOOMBERG_RED }}>+ ${totalUnrealizedPnL >= 0 ? '+' : ''}{totalUnrealizedPnL.toFixed(2)} ({totalUnrealizedPnLPercent >= 0 ? '+' : ''}{totalUnrealizedPnLPercent.toFixed(2)}%)+ </span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_GRAY }}>COST BASIS:</span>+ <span style={{ color: BLOOMBERG_CYAN }}>${totalCostBasis.toLocaleString(undefined, {minimumFractionDigits: 2})}</span>+ </div>+ </div>++ {/* Function Keys */}+ <div style={{+ backgroundColor: BLOOMBERG_PANEL_BG,+ borderBottom: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '2px 4px',+ flexShrink: 0+ }}>+ <div style={{ display: 'grid', gridTemplateColumns: 'repeat(12, 1fr)', gap: '2px' }}>+ {[+ { key: "F1", label: "POSITIONS", view: "POSITIONS" },+ { key: "F2", label: "SECTORS", view: "SECTORS" },+ { key: "F3", label: "PERFORMANCE", view: "PERFORMANCE" },+ { key: "F4", label: "ANALYTICS", view: "ANALYTICS" },+ { key: "F5", label: "ORDERS", view: "ORDERS" },+ { key: "F6", label: "HISTORY", view: "HISTORY" },+ { key: "F7", label: "ALERTS", view: "ALERTS" },+ { key: "F8", label: "REPORTS", view: "REPORTS" },+ { key: "F9", label: "IMPORT", view: "IMPORT" },+ { key: "F10", label: "EXPORT", view: "EXPORT" },+ { key: "F11", label: "SETTINGS", view: "SETTINGS" },+ { key: "F12", label: "HELP", view: "HELP" }+ ].map(item => (+ <button key={item.key}+ onClick={() => setSelectedView(item.view)}+ style={{+ backgroundColor: selectedView === item.view ? BLOOMBERG_ORANGE : BLOOMBERG_DARK_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ color: selectedView === item.view ? BLOOMBERG_DARK_BG : BLOOMBERG_WHITE,+ padding: '2px 4px',+ fontSize: '9px',+ height: '16px',+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'center',+ fontWeight: selectedView === item.view ? 'bold' : 'normal',+ cursor: 'pointer'+ }}>+ <span style={{ color: BLOOMBERG_YELLOW }}>{item.key}:</span>+ <span style={{ marginLeft: '2px' }}>{item.label}</span>+ </button>+ ))}+ </div>+ </div>++ {/* Main Content */}+ <div style={{ flex: 1, overflow: 'auto', padding: '4px', backgroundColor: '#050505' }}>+ <div style={{ display: 'flex', gap: '4px', height: '100%' }}>++ {/* Left Panel - Portfolio Summary */}+ <div style={{+ width: '320px',+ backgroundColor: BLOOMBERG_PANEL_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '4px',+ overflow: 'auto'+ }}>+ <div style={{ color: BLOOMBERG_ORANGE, fontSize: '11px', fontWeight: 'bold', marginBottom: '4px' }}>+ PORTFOLIO SUMMARY+ </div>+ <div style={{ borderBottom: `1px solid ${BLOOMBERG_GRAY}`, marginBottom: '8px' }}></div>++ {/* Key Metrics */}+ <div style={{ marginBottom: '12px' }}>+ <div style={{ padding: '6px', backgroundColor: 'rgba(255,165,0,0.1)', marginBottom: '4px' }}>+ <div style={{ color: BLOOMBERG_GRAY, fontSize: '9px', marginBottom: '2px' }}>TOTAL MARKET VALUE</div>+ <div style={{ color: BLOOMBERG_WHITE, fontSize: '16px', fontWeight: 'bold' }}>+ ${totalMarketValue.toLocaleString(undefined, {minimumFractionDigits: 2})}+ </div>+ </div>++ <div style={{ padding: '6px', backgroundColor: totalDayChange >= 0 ? 'rgba(0,200,0,0.05)' : 'rgba(255,0,0,0.05)', marginBottom: '4px' }}>+ <div style={{ color: BLOOMBERG_GRAY, fontSize: '9px', marginBottom: '2px' }}>TODAY'S CHANGE</div>+ <div style={{ color: totalDayChange >= 0 ? BLOOMBERG_GREEN : BLOOMBERG_RED, fontSize: '14px', fontWeight: 'bold' }}>+ ${totalDayChange >= 0 ? '+' : ''}{totalDayChange.toFixed(2)}+ </div>+ <div style={{ color: totalDayChange >= 0 ? BLOOMBERG_GREEN : BLOOMBERG_RED, fontSize: '10px' }}>+ ({totalDayChangePercent >= 0 ? '+' : ''}{totalDayChangePercent.toFixed(2)}%)+ </div>+ </div>++ <div style={{ padding: '6px', backgroundColor: totalUnrealizedPnL >= 0 ? 'rgba(0,200,0,0.05)' : 'rgba(255,0,0,0.05)' }}>+ <div style={{ color: BLOOMBERG_GRAY, fontSize: '9px', marginBottom: '2px' }}>UNREALIZED P&L</div>+ <div style={{ color: totalUnrealizedPnL >= 0 ? BLOOMBERG_GREEN : BLOOMBERG_RED, fontSize: '14px', fontWeight: 'bold' }}>+ ${totalUnrealizedPnL >= 0 ? '+' : ''}{totalUnrealizedPnL.toFixed(2)}+ </div>+ <div style={{ color: totalUnrealizedPnL >= 0 ? BLOOMBERG_GREEN : BLOOMBERG_RED, fontSize: '10px' }}>+ ({totalUnrealizedPnLPercent >= 0 ? '+' : ''}{totalUnrealizedPnLPercent.toFixed(2)}%)+ </div>+ </div>+ </div>++ {/* Additional Metrics */}+ <div style={{ fontSize: '9px', lineHeight: '1.5', marginBottom: '12px' }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Cost Basis:</span>+ <span style={{ color: BLOOMBERG_WHITE }}>${totalCostBasis.toLocaleString()}</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Cash Available:</span>+ <span style={{ color: BLOOMBERG_CYAN }}>$25,432.18</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Buying Power:</span>+ <span style={{ color: BLOOMBERG_CYAN }}>$50,864.36</span>+ </div>+ <div style={{ borderTop: `1px solid ${BLOOMBERG_GRAY}`, marginTop: '4px', paddingTop: '4px' }}>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: BLOOMBERG_CYAN }}>Total Equity:</span>+ <span style={{ color: BLOOMBERG_WHITE, fontWeight: 'bold' }}>+ ${(totalMarketValue + 25432.18).toLocaleString(undefined, {minimumFractionDigits: 2})}+ </span>+ </div>+ </div>+ </div>++ <div style={{ borderTop: `1px solid ${BLOOMBERG_GRAY}`, paddingTop: '8px', marginBottom: '8px' }}>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '10px', fontWeight: 'bold', marginBottom: '4px' }}>+ SECTOR ALLOCATION+ </div>+ {Object.entries(sectorAllocation).map(([sector, data], index) => (+ <div key={index} style={{+ marginBottom: '3px',+ padding: '3px',+ backgroundColor: 'rgba(255,255,255,0.02)',+ fontSize: '9px'+ }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '1px' }}>+ <span style={{ color: BLOOMBERG_WHITE }}>{sector}</span>+ <span style={{ color: BLOOMBERG_CYAN }}>{data.weight.toFixed(1)}%</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between', color: BLOOMBERG_GRAY }}>+ <span>${data.value.toLocaleString()}</span>+ </div>+ </div>+ ))}+ </div>++ <div style={{ borderTop: `1px solid ${BLOOMBERG_GRAY}`, paddingTop: '8px' }}>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '10px', fontWeight: 'bold', marginBottom: '4px' }}>+ PERFORMANCE METRICS+ </div>+ <div style={{ fontSize: '9px', lineHeight: '1.5' }}>+ {performanceMetrics.map((metric, index) => (+ <div key={index} style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>{metric.label}:</span>+ <span style={{ color: metric.color }}>{metric.value}</span>+ </div>+ ))}+ </div>+ </div>+ </div>++ {/* Center Panel - Positions Table */}+ <div style={{+ flex: 1,+ backgroundColor: BLOOMBERG_PANEL_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '4px',+ overflow: 'auto'+ }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '4px' }}>+ <div style={{ color: BLOOMBERG_ORANGE, fontSize: '11px', fontWeight: 'bold' }}>+ CURRENT POSITIONS+ </div>+ <div style={{ display: 'flex', gap: '4px', fontSize: '9px' }}>+ <button onClick={() => setSortBy('WEIGHT')} style={{+ padding: '2px 6px',+ backgroundColor: sortBy === 'WEIGHT' ? BLOOMBERG_ORANGE : BLOOMBERG_DARK_BG,+ color: sortBy === 'WEIGHT' ? BLOOMBERG_DARK_BG : BLOOMBERG_WHITE,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ cursor: 'pointer'+ }}>WEIGHT</button>+ <button onClick={() => setSortBy('PNL')} style={{+ padding: '2px 6px',+ backgroundColor: sortBy === 'PNL' ? BLOOMBERG_ORANGE : BLOOMBERG_DARK_BG,+ color: sortBy === 'PNL' ? BLOOMBERG_DARK_BG : BLOOMBERG_WHITE,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ cursor: 'pointer'+ }}>P&L</button>+ <button onClick={() => setSortBy('VALUE')} style={{+ padding: '2px 6px',+ backgroundColor: sortBy === 'VALUE' ? BLOOMBERG_ORANGE : BLOOMBERG_DARK_BG,+ color: sortBy === 'VALUE' ? BLOOMBERG_DARK_BG : BLOOMBERG_WHITE,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ cursor: 'pointer'+ }}>VALUE</button>+ </div>+ </div>+ <div style={{ borderBottom: `1px solid ${BLOOMBERG_GRAY}`, marginBottom: '8px' }}></div>++ {/* Table Header */}+ <div style={{+ display: 'grid',+ gridTemplateColumns: '80px 180px 80px 90px 90px 100px 100px 120px 120px 80px',+ gap: '4px',+ padding: '4px',+ backgroundColor: 'rgba(255,255,255,0.05)',+ fontSize: '9px',+ fontWeight: 'bold',+ marginBottom: '2px'+ }}>+ <div style={{ color: BLOOMBERG_GRAY }}>TICKER</div>+ <div style={{ color: BLOOMBERG_GRAY }}>NAME</div>+ <div style={{ color: BLOOMBERG_GRAY }}>QTY</div>+ <div style={{ color: BLOOMBERG_GRAY }}>AVG PRICE</div>+ <div style={{ color: BLOOMBERG_GRAY }}>CURRENT</div>+ <div style={{ color: BLOOMBERG_GRAY }}>MKT VALUE</div>+ <div style={{ color: BLOOMBERG_GRAY }}>COST BASIS</div>+ <div style={{ color: BLOOMBERG_GRAY }}>UNREALIZED P&L</div>+ <div style={{ color: BLOOMBERG_GRAY }}>DAY CHANGE</div>+ <div style={{ color: BLOOMBERG_GRAY }}>WEIGHT</div>+ </div>++ {/* Position Rows */}+ {positions.map((pos, index) => (+ <div key={index} style={{+ display: 'grid',+ gridTemplateColumns: '80px 180px 80px 90px 90px 100px 100px 120px 120px 80px',+ gap: '4px',+ padding: '6px 4px',+ backgroundColor: index % 2 === 0 ? 'rgba(255,255,255,0.02)' : 'transparent',+ borderLeft: `3px solid ${pos.unrealizedPnL >= 0 ? BLOOMBERG_GREEN : BLOOMBERG_RED}`,+ fontSize: '10px',+ marginBottom: '1px'+ }}>+ <div style={{ color: BLOOMBERG_CYAN, fontWeight: 'bold' }}>{pos.ticker}</div>+ <div style={{ color: BLOOMBERG_WHITE, overflow: 'hidden', textOverflow: 'ellipsis' }}>{pos.name}</div>+ <div style={{ color: BLOOMBERG_WHITE }}>{pos.quantity.toLocaleString()}</div>+ <div style={{ color: BLOOMBERG_GRAY }}>${pos.avgPrice.toFixed(2)}</div>+ <div style={{ color: BLOOMBERG_WHITE }}>${pos.currentPrice.toFixed(2)}</div>+ <div style={{ color: BLOOMBERG_WHITE }}>${pos.marketValue.toLocaleString()}</div>+ <div style={{ color: BLOOMBERG_GRAY }}>${pos.costBasis.toLocaleString()}</div>+ <div>+ <div style={{ color: pos.unrealizedPnL >= 0 ? BLOOMBERG_GREEN : BLOOMBERG_RED }}>+ ${pos.unrealizedPnL >= 0 ? '+' : ''}{pos.unrealizedPnL.toFixed(2)}+ </div>+ <div style={{ color: pos.unrealizedPnL >= 0 ? BLOOMBERG_GREEN : BLOOMBERG_RED, fontSize: '8px' }}>+ ({pos.unrealizedPnLPercent >= 0 ? '+' : ''}{pos.unrealizedPnLPercent.toFixed(2)}%)+ </div>+ </div>+ <div>+ <div style={{ color: pos.dayChange >= 0 ? BLOOMBERG_GREEN : BLOOMBERG_RED }}>+ ${pos.dayChange >= 0 ? '+' : ''}{pos.dayChange.toFixed(2)}+ </div>+ <div style={{ color: pos.dayChange >= 0 ? BLOOMBERG_GREEN : BLOOMBERG_RED, fontSize: '8px' }}>+ ({pos.dayChangePercent >= 0 ? '+' : ''}{pos.dayChangePercent.toFixed(2)}%)+ </div>+ </div>+ <div style={{ color: BLOOMBERG_YELLOW }}>{pos.weight.toFixed(1)}%</div>+ </div>+ ))}++ {/* Totals Row */}+ <div style={{+ display: 'grid',+ gridTemplateColumns: '80px 180px 80px 90px 90px 100px 100px 120px 120px 80px',+ gap: '4px',+ padding: '6px 4px',+ backgroundColor: 'rgba(255,165,0,0.1)',+ borderTop: `2px solid ${BLOOMBERG_ORANGE}`,+ fontSize: '10px',+ fontWeight: 'bold',+ marginTop: '4px'+ }}>+ <div style={{ color: BLOOMBERG_ORANGE }}>TOTAL</div>+ <div></div>+ <div></div>+ <div></div>+ <div></div>+ <div style={{ color: BLOOMBERG_WHITE }}>${totalMarketValue.toLocaleString()}</div>+ <div style={{ color: BLOOMBERG_GRAY }}>${totalCostBasis.toLocaleString()}</div>+ <div>+ <div style={{ color: totalUnrealizedPnL >= 0 ? BLOOMBERG_GREEN : BLOOMBERG_RED }}>+ ${totalUnrealizedPnL >= 0 ? '+' : ''}{totalUnrealizedPnL.toFixed(2)}+ </div>+ <div style={{ color: totalUnrealizedPnL >= 0 ? BLOOMBERG_GREEN : BLOOMBERG_RED, fontSize: '8px' }}>+ ({totalUnrealizedPnLPercent >= 0 ? '+' : ''}{totalUnrealizedPnLPercent.toFixed(2)}%)+ </div>+ </div>+ <div>+ <div style={{ color: totalDayChange >= 0 ? BLOOMBERG_GREEN : BLOOMBERG_RED }}>+ ${totalDayChange >= 0 ? '+' : ''}{totalDayChange.toFixed(2)}+ </div>+ <div style={{ color: totalDayChange >= 0 ? BLOOMBERG_GREEN : BLOOMBERG_RED, fontSize: '8px' }}>+ ({totalDayChangePercent >= 0 ? '+' : ''}{totalDayChangePercent.toFixed(2)}%)+ </div>+ </div>+ <div style={{ color: BLOOMBERG_YELLOW }}>100.0%</div>+ </div>+ </div>++ {/* Right Panel - Activity & Transactions */}+ <div style={{+ width: '320px',+ backgroundColor: BLOOMBERG_PANEL_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '4px',+ overflow: 'auto'+ }}>+ <div style={{ color: BLOOMBERG_ORANGE, fontSize: '11px', fontWeight: 'bold', marginBottom: '4px' }}>+ RECENT TRANSACTIONS+ </div>+ <div style={{ borderBottom: `1px solid ${BLOOMBERG_GRAY}`, marginBottom: '8px' }}></div>++ {recentTransactions.map((txn, index) => (+ <div key={index} style={{+ marginBottom: '6px',+ padding: '6px',+ backgroundColor: 'rgba(255,255,255,0.02)',+ borderLeft: `3px solid ${txn.type === 'BUY' ? BLOOMBERG_GREEN : BLOOMBERG_RED}`,+ fontSize: '9px'+ }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>{txn.date}</span>+ <span style={{ color: txn.type === 'BUY' ? BLOOMBERG_GREEN : BLOOMBERG_RED, fontWeight: 'bold' }}>+ {txn.type}+ </span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_CYAN, fontWeight: 'bold' }}>{txn.ticker}</span>+ <span style={{ color: BLOOMBERG_WHITE }}>{txn.quantity} @ ${txn.price.toFixed(2)}</span>+ </div>+ <div style={{ color: BLOOMBERG_GRAY, textAlign: 'right' }}>+ Total: ${txn.total.toLocaleString()}+ </div>+ </div>+ ))}++ <div style={{ borderTop: `1px solid ${BLOOMBERG_GRAY}`, paddingTop: '8px', marginTop: '12px' }}>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '10px', fontWeight: 'bold', marginBottom: '4px' }}>+ MARKET INDICATORS+ </div>+ {[+ { name: 'S&P 500', value: '4,850.25', change: '+0.87%', color: BLOOMBERG_GREEN },+ { name: 'NASDAQ', value: '15,234.56', change: '+1.23%', color: BLOOMBERG_GREEN },+ { name: 'DOW JONES', value: '38,742.18', change: '+0.56%', color: BLOOMBERG_GREEN },+ { name: 'VIX', value: '13.45', change: '-5.23%', color: BLOOMBERG_GREEN },+ { name: '10Y YIELD', value: '4.12%', change: '+0.03', color: BLOOMBERG_RED }+ ].map((indicator, index) => (+ <div key={index} style={{+ display: 'flex',+ justifyContent: 'space-between',+ padding: '3px',+ marginBottom: '2px',+ backgroundColor: 'rgba(255,255,255,0.02)',+ fontSize: '9px'+ }}>+ <span style={{ color: BLOOMBERG_WHITE }}>{indicator.name}</span>+ <div style={{ textAlign: 'right' }}>+ <div style={{ color: BLOOMBERG_CYAN }}>{indicator.value}</div>+ <div style={{ color: indicator.color, fontSize: '8px' }}>{indicator.change}</div>+ </div>+ </div>+ ))}+ </div>++ <div style={{ borderTop: `1px solid ${BLOOMBERG_GRAY}`, paddingTop: '8px', marginTop: '12px' }}>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '10px', fontWeight: 'bold', marginBottom: '4px' }}>+ PORTFOLIO ALERTS+ </div>+ {[+ { type: 'TARGET', message: 'AAPL reached target price $185', time: '2h ago', color: BLOOMBERG_GREEN },+ { type: 'STOP', message: 'GOOGL approaching stop loss', time: '5h ago', color: BLOOMBERG_RED },+ { type: 'NEWS', message: 'NVDA earnings report tomorrow', time: '1d ago', color: BLOOMBERG_YELLOW }+ ].map((alert, index) => (+ <div key={index} style={{+ marginBottom: '4px',+ padding: '4px',+ backgroundColor: 'rgba(255,255,255,0.02)',+ borderLeft: `2px solid ${alert.color}`,+ fontSize: '8px',+ lineHeight: '1.3'+ }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '1px' }}>+ <span style={{ color: alert.color, fontWeight: 'bold' }}>[{alert.type}]</span>+ <span style={{ color: BLOOMBERG_GRAY }}>{alert.time}</span>+ </div>+ <div style={{ color: BLOOMBERG_WHITE }}>{alert.message}</div>+ </div>+ ))}+ </div>+ </div>+ </div>+ </div>++ {/* Status Bar */}+ <div style={{+ borderTop: `1px solid ${BLOOMBERG_GRAY}`,+ backgroundColor: BLOOMBERG_PANEL_BG,+ padding: '2px 8px',+ fontSize: '10px',+ color: BLOOMBERG_GRAY,+ flexShrink: 0+ }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>+ <div style={{ display: 'flex', gap: '16px' }}>+ <span>Fincept Portfolio Manager v2.1.0 | Real-time position tracking</span>+ <span>Positions: {positions.length} | Market Value: ${totalMarketValue.toLocaleString()}</span>+ </div>+ <div style={{ display: 'flex', gap: '16px' }}>+ <span>View: {selectedView}</span>+ <span>Sort: {sortBy}</span>+ <span style={{ color: BLOOMBERG_GREEN }}>STATUS: LIVE</span>+ </div>+ </div>+ </div>+ </div>+ );+};++export default PortfolioTab;\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/tabs/ProfileTab.tsx b/fincept-terminal-desktop/src/components/tabs/ProfileTab.tsxnew file mode 100644index 000000000..eb4b79e17--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/ProfileTab.tsx@@ -0,0 +1,386 @@+import React, { useState, useEffect } from 'react';++interface SessionData {+ user_type: 'guest' | 'registered' | 'unknown';+ authenticated: boolean;+ api_key?: string;+ device_id?: string;+ user_info?: {+ username: string;+ email: string;+ account_type: string;+ created_at: string;+ credit_balance: number;+ };+ requests_today: number;+ daily_limit: number;+}++const ProfileTab: React.FC = () => {+ const [sessionData, setSessionData] = useState<SessionData>({+ user_type: 'guest',+ authenticated: false,+ api_key: 'fk_guest_abc123def456',+ device_id: 'device_12345678901234567890',+ requests_today: 15,+ daily_limit: 50+ });++ const [lastRefresh, setLastRefresh] = useState<Date>(new Date());+ const [requestCount, setRequestCount] = useState(15);+ const [usageStats, setUsageStats] = useState({+ total_requests: 1250,+ total_credits_used: 3425+ });++ useEffect(() => {+ const timer = setInterval(() => {+ setLastRefresh(new Date());+ }, 5000);++ return () => clearInterval(timer);+ }, []);++ // Bloomberg Terminal Colors (matching DearPyGUI style)+ const COLORS = {+ success: '#64ff64',+ warning: '#ffc864',+ error: '#ff9696',+ info: '#c8ffc8',+ title: '#ffff64'+ };++ const manualRefresh = () => {+ setLastRefresh(new Date());+ setRequestCount(prev => prev + 1);+ };++ const logoutUser = () => {+ setSessionData({+ user_type: 'guest',+ authenticated: false,+ device_id: `cleared_${Date.now()}`,+ requests_today: 0,+ daily_limit: 50+ });+ };++ const showSignupInfo = () => {+ alert('Sign up functionality would open here');+ };++ const showLoginInfo = () => {+ alert('Login functionality would open here');+ };++ const regenerateApiKey = () => {+ const newKey = `fk_user_${Math.random().toString(36).substring(2, 15)}`;+ setSessionData(prev => ({ ...prev, api_key: newKey }));+ };++ // Header component matching DearPyGUI style+ const Header = ({ title, lastRefresh }: { title: string, lastRefresh: Date }) => (+ <div className="mb-5">+ <div className="flex items-center gap-5 mb-2">+ <span style={{ color: COLORS.title }} className="text-lg font-mono">{title}</span>+ <span style={{ color: COLORS.info }} className="text-sm font-mono">+ 🔄 Refreshed: {lastRefresh.toLocaleTimeString()}+ </span>+ <button+ onClick={manualRefresh}+ className="bg-gray-700 hover:bg-gray-600 text-white px-3 py-1 text-xs font-mono border border-gray-600"+ >+ 🔄 Refresh+ </button>+ <button+ onClick={logoutUser}+ className="bg-gray-700 hover:bg-gray-600 text-white px-3 py-1 text-xs font-mono border border-gray-600"+ >+ 🚪 Logout+ </button>+ </div>+ <div className="border-t border-gray-600"></div>+ </div>+ );++ // Info Widget component matching DearPyGUI child window style+ const InfoWidget = ({ title, children, width = 350, height = 450 }: {+ title: string,+ children: React.ReactNode,+ width?: number,+ height?: number+ }) => (+ <div+ className="border border-gray-600 bg-black p-3"+ style={{ width: `${width}px`, height: `${height}px`, overflow: 'auto' }}+ >+ <div style={{ color: COLORS.title }} className="text-sm font-mono mb-2">{title}</div>+ <div className="border-t border-gray-600 mb-3"></div>+ <div className="space-y-2">+ {children}+ </div>+ </div>+ );++ // Two column layout matching DearPyGUI horizontal group+ const TwoColumnLayout = ({ left, right }: { left: React.ReactNode, right: React.ReactNode }) => (+ <div className="flex gap-5">+ {left}+ {right}+ </div>+ );++ // Button group component+ const ButtonGroup = ({ buttons }: { buttons: Array<{ label: string, callback: () => void }> }) => (+ <div className="space-y-1">+ {buttons.map((button, index) => (+ <div key={index}>+ <button+ onClick={button.callback}+ className="bg-gray-700 hover:bg-gray-600 text-white px-4 py-2 text-xs font-mono border border-gray-600 w-70"+ style={{ width: '280px' }}+ >+ {button.label}+ </button>+ </div>+ ))}+ </div>+ );++ // Text line component with optional color+ const TextLine = ({ text, color }: { text: string, color?: string }) => (+ <div style={{ color: color || '#ffffff' }} className="text-xs font-mono leading-relaxed">+ {text}+ </div>+ );++ const Spacer = ({ height = 10 }: { height?: number }) => (+ <div style={{ height: `${height}px` }}></div>+ );++ // Get API key display format+ const getApiKeyInfo = (apiKey?: string, isUser = false) => {+ if (!apiKey) return "No API key";++ if (isUser) {+ return `API Key: ${apiKey.substring(0, 12)}...`;+ }++ if (apiKey.startsWith("fk_guest_")) {+ return `Guest API Key: ${apiKey.substring(0, 15)}...`;+ }++ return "No API key";+ };++ // Format date+ const formatDate = (dateStr?: string) => {+ if (!dateStr) return 'N/A';+ return new Date(dateStr).toLocaleDateString();+ };++ const renderGuestProfile = () => {+ const displayDeviceId = sessionData.device_id?.substring(0, 20) + "..." || 'Unknown';+ const remaining = Math.max(0, sessionData.daily_limit - sessionData.requests_today);++ return (+ <div className="p-4">+ <Header title="👤 Guest Profile" lastRefresh={lastRefresh} />++ <TwoColumnLayout+ left={+ <InfoWidget title="Current Session Status">+ <TextLine text="Account Type: Guest User" />+ <TextLine text={`Device ID: ${displayDeviceId}`} />+ <Spacer />+ <TextLine text={getApiKeyInfo(sessionData.api_key)} />+ <Spacer />+ <TextLine text={`Session Requests: ${requestCount}`} />+ <TextLine text={`Today's Requests: ${sessionData.requests_today}/${sessionData.daily_limit}`} />+ <TextLine+ text={`Remaining Today: ${remaining}`}+ color={remaining > 10 ? COLORS.success : COLORS.error}+ />+ <Spacer />+ <TextLine text="✓ Basic market data" />+ <TextLine text="✓ Real-time quotes" />+ <TextLine text="✓ Public databases" />+ </InfoWidget>+ }+ right={+ <InfoWidget title="Upgrade Your Access">+ <TextLine+ text={sessionData.api_key?.startsWith("fk_guest_") ? "🔄 Current: Guest API Key" : "🔄 Current: Offline Mode"}+ color={COLORS.warning}+ />+ <Spacer />+ {sessionData.api_key?.startsWith("fk_guest_") ? (+ <>+ <TextLine text="• Temporary access (24 hours)" />+ <TextLine text="• 50 requests per day" />+ </>+ ) : (+ <TextLine text="• No API access" />+ )}+ <Spacer />+ <TextLine text="🔑 Create Account" color={COLORS.info} />+ <TextLine text="Get unlimited access:" />+ <TextLine text="• Permanent API key" />+ <TextLine text="• Unlimited requests" />+ <TextLine text="• All databases access" />+ <TextLine text="• Premium features" />+ <Spacer height={20} />+ <ButtonGroup buttons={[+ { label: "Create Free Account", callback: showSignupInfo },+ { label: "Sign In to Account", callback: showLoginInfo }+ ]} />+ </InfoWidget>+ }+ />++ <Spacer height={20} />++ {/* Session Stats - Full Width */}+ <InfoWidget title="Session Statistics" width={750} height={150}>+ <div className="grid grid-cols-4 gap-4 text-xs font-mono">+ <div>+ <TextLine text="Request Count:" color={COLORS.info} />+ <TextLine text={requestCount.toString()} />+ </div>+ <div>+ <TextLine text="Daily Usage:" color={COLORS.info} />+ <TextLine text={`${sessionData.requests_today}/${sessionData.daily_limit}`} />+ </div>+ <div>+ <TextLine text="Status:" color={COLORS.info} />+ <TextLine text="Active" color={COLORS.success} />+ </div>+ <div>+ <TextLine text="Session Time:" color={COLORS.info} />+ <TextLine text="00:45:23" />+ </div>+ </div>+ </InfoWidget>+ </div>+ );+ };++ const renderUserProfile = () => {+ const userInfo = sessionData.user_info;+ const creditBalance = userInfo?.credit_balance || 0;++ let balanceColor, status;+ if (creditBalance > 1000) {+ balanceColor = COLORS.success;+ status = "Excellent";+ } else if (creditBalance > 100) {+ balanceColor = COLORS.warning;+ status = "Good";+ } else {+ balanceColor = COLORS.error;+ status = "Low Credits";+ }++ return (+ <div className="p-4">+ <Header title={`🔑 ${userInfo?.username || 'User'}'s Profile`} lastRefresh={lastRefresh} />++ <TwoColumnLayout+ left={+ <InfoWidget title="Account Details">+ <TextLine text={`Username: ${userInfo?.username || 'N/A'}`} />+ <TextLine text={`Email: ${userInfo?.email || 'N/A'}`} />+ <TextLine text={`Account Type: ${userInfo?.account_type?.charAt(0).toUpperCase() + userInfo?.account_type?.slice(1) || 'Free'}`} />+ <TextLine text={`Member Since: ${formatDate(userInfo?.created_at)}`} />+ <Spacer />+ <TextLine text="Authentication:" color={COLORS.info} />+ <TextLine text={getApiKeyInfo(sessionData.api_key, true)} />+ <Spacer />+ <TextLine text="✓ Unlimited API requests" />+ <TextLine text="✓ All database access" />+ <TextLine text="✓ Premium features" />+ <Spacer height={20} />+ <ButtonGroup buttons={[+ { label: "Regenerate API Key", callback: regenerateApiKey },+ { label: "Switch Account", callback: logoutUser }+ ]} />+ </InfoWidget>+ }+ right={+ <InfoWidget title="Credits & Usage">+ <TextLine text={`Current Balance: ${creditBalance} credits`} />+ <TextLine text={`Status: ${status}`} color={balanceColor} />+ <Spacer />+ <TextLine text="Live Usage Stats:" color={COLORS.info} />+ <TextLine text={`Total Requests: ${usageStats.total_requests}`} />+ <TextLine text={`Credits Used: ${usageStats.total_credits_used}`} />+ <TextLine text={`This Session: ${requestCount}`} />+ <Spacer />+ <TextLine text="Quick Actions:" />+ </InfoWidget>+ }+ />++ <Spacer height={20} />++ {/* User Stats - Full Width */}+ <InfoWidget title="User Statistics" width={750} height={150}>+ <div className="grid grid-cols-4 gap-4 text-xs font-mono">+ <div>+ <TextLine text="Total Requests:" color={COLORS.info} />+ <TextLine text={usageStats.total_requests.toLocaleString()} />+ </div>+ <div>+ <TextLine text="Credits Balance:" color={COLORS.info} />+ <TextLine text={creditBalance.toLocaleString()} color={balanceColor} />+ </div>+ <div>+ <TextLine text="Account Status:" color={COLORS.info} />+ <TextLine text="Active" color={COLORS.success} />+ </div>+ <div>+ <TextLine text="API Status:" color={COLORS.info} />+ <TextLine text="Connected" color={COLORS.success} />+ </div>+ </div>+ </InfoWidget>+ </div>+ );+ };++ const renderUnknownProfile = () => (+ <div className="p-4">+ <Header title="❓ Unknown Session State" lastRefresh={lastRefresh} />++ <InfoWidget title="Session Status" width={500} height={200}>+ <TextLine text="Unable to determine authentication status" />+ <TextLine text="This may indicate a configuration issue." />+ <Spacer />+ <TextLine text="Try refreshing or restarting the application" color={COLORS.warning} />+ <Spacer height={40} />+ <ButtonGroup buttons={[+ { label: "🔄 Refresh Profile", callback: manualRefresh },+ { label: "Clear Session & Restart", callback: logoutUser }+ ]} />+ </InfoWidget>+ </div>+ );++ // Main render logic based on user type+ const renderContent = () => {+ switch (sessionData.user_type) {+ case 'guest': return renderGuestProfile();+ case 'registered': return renderUserProfile();+ case 'unknown': return renderUnknownProfile();+ default: return renderUnknownProfile();+ }+ };++ return (+ <div className="h-full bg-black text-white font-mono text-xs overflow-auto">+ {renderContent()}+ </div>+ );+};++export default ProfileTab;\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/tabs/ScreenerTab.tsx b/fincept-terminal-desktop/src/components/tabs/ScreenerTab.tsxnew file mode 100644index 000000000..afb32a15f--- /dev/null+++ b/fincept-terminal-desktop/src/components/tabs/ScreenerTab.tsx@@ -0,0 +1,819 @@+import React, { useState, useEffect } from 'react';++interface Stock {+ ticker: string;+ name: string;+ sector: string;+ price: number;+ change: number;+ changePercent: number;+ marketCap: string;+ pe: number;+ ps: number;+ pb: number;+ forwardPE: number;+ peg: number;+ dividend: number;+ roe: number;+ roa: number;+ debtToEquity: number;+ currentRatio: number;+ eps: number;+ revenue: string;+ revenueGrowth: number;+ profitMargin: number;+ beta: number;+ volume: string;+ avgVolume: string;+ week52High: number;+ week52Low: number;+}++const ScreenerTab: React.FC = () => {+ const [currentTime, setCurrentTime] = useState(new Date());+ const [filters, setFilters] = useState({+ marketCapMin: '',+ marketCapMax: '',+ peMin: '',+ peMax: '',+ dividendMin: '',+ priceMin: '',+ priceMax: '',+ sector: 'ALL',+ volumeMin: ''+ });++ const COLOR_ORANGE = '#FFA500';+ const COLOR_WHITE = '#FFFFFF';+ const COLOR_RED = '#FF0000';+ const COLOR_GREEN = '#00C800';+ const COLOR_YELLOW = '#FFFF00';+ const COLOR_GRAY = '#787878';+ const COLOR_BLUE = '#6496FA';+ const COLOR_PURPLE = '#C864FF';+ const COLOR_CYAN = '#00FFFF';+ const COLOR_DARK_BG = '#000000';+ const COLOR_PANEL_BG = '#0a0a0a';++ useEffect(() => {+ const timer = setInterval(() => setCurrentTime(new Date()), 1000);+ return () => clearInterval(timer);+ }, []);++ const stocks: Stock[] = [+ {+ ticker: 'AAPL',+ name: 'Apple Inc',+ sector: 'Technology',+ price: 178.45,+ change: 2.34,+ changePercent: 1.33,+ marketCap: '$2.78T',+ pe: 28.4,+ ps: 7.2,+ pb: 45.6,+ forwardPE: 26.8,+ peg: 2.1,+ dividend: 0.55,+ roe: 147.3,+ roa: 27.8,+ debtToEquity: 1.89,+ currentRatio: 0.98,+ eps: 6.29,+ revenue: '$394.3B',+ revenueGrowth: 2.1,+ profitMargin: 25.3,+ beta: 1.24,+ volume: '$42.5M',+ avgVolume: '$38.2M',+ week52High: 199.62,+ week52Low: 164.08+ },+ {+ ticker: 'MSFT',+ name: 'Microsoft Corp',+ sector: 'Technology',+ price: 412.34,+ change: 5.67,+ changePercent: 1.39,+ marketCap: '$3.07T',+ pe: 35.2,+ ps: 12.4,+ pb: 12.8,+ forwardPE: 31.4,+ peg: 2.4,+ dividend: 0.72,+ roe: 42.7,+ roa: 16.4,+ debtToEquity: 0.45,+ currentRatio: 1.77,+ eps: 11.73,+ revenue: '$227.6B',+ revenueGrowth: 13.2,+ profitMargin: 36.7,+ beta: 0.89,+ volume: '$28.3M',+ avgVolume: '$25.7M',+ week52High: 425.22,+ week52Low: 309.45+ },+ {+ ticker: 'GOOGL',+ name: 'Alphabet Inc',+ sector: 'Technology',+ price: 145.67,+ change: -1.23,+ changePercent: -0.84,+ marketCap: '$1.82T',+ pe: 24.6,+ ps: 5.8,+ pb: 6.4,+ forwardPE: 22.1,+ peg: 1.8,+ dividend: 0.00,+ roe: 27.8,+ roa: 18.9,+ debtToEquity: 0.12,+ currentRatio: 2.56,+ eps: 5.93,+ revenue: '$307.4B',+ revenueGrowth: 8.7,+ profitMargin: 25.9,+ beta: 1.05,+ volume: '$19.8M',+ avgVolume: '$21.4M',+ week52High: 156.23,+ week52Low: 121.46+ },+ {+ ticker: 'NVDA',+ name: 'NVIDIA Corp',+ sector: 'Technology',+ price: 878.34,+ change: 12.45,+ changePercent: 1.44,+ marketCap: '$2.18T',+ pe: 68.7,+ ps: 38.2,+ pb: 55.4,+ forwardPE: 52.3,+ peg: 1.2,+ dividend: 0.04,+ roe: 98.4,+ roa: 56.7,+ debtToEquity: 0.28,+ currentRatio: 3.45,+ eps: 12.79,+ revenue: '$60.9B',+ revenueGrowth: 125.9,+ profitMargin: 53.4,+ beta: 1.67,+ volume: '$52.3M',+ avgVolume: '$48.9M',+ week52High: 974.23,+ week52Low: 389.12+ },+ {+ ticker: 'JPM',+ name: 'JPMorgan Chase',+ sector: 'Financials',+ price: 187.23,+ change: 1.89,+ changePercent: 1.02,+ marketCap: '$535.6B',+ pe: 11.2,+ ps: 3.4,+ pb: 1.8,+ forwardPE: 10.4,+ peg: 1.1,+ dividend: 2.84,+ roe: 16.8,+ roa: 1.3,+ debtToEquity: 1.34,+ currentRatio: 0.78,+ eps: 16.72,+ revenue: '$158.1B',+ revenueGrowth: 22.3,+ profitMargin: 32.1,+ beta: 1.12,+ volume: '$8.9M',+ avgVolume: '$9.2M',+ week52High: 199.45,+ week52Low: 135.23+ },+ {+ ticker: 'JNJ',+ name: 'Johnson & Johnson',+ sector: 'Healthcare',+ price: 156.78,+ change: 0.45,+ changePercent: 0.29,+ marketCap: '$389.2B',+ pe: 15.4,+ ps: 4.2,+ pb: 5.6,+ forwardPE: 14.8,+ peg: 2.8,+ dividend: 2.95,+ roe: 23.4,+ roa: 9.8,+ debtToEquity: 0.52,+ currentRatio: 1.12,+ eps: 10.18,+ revenue: '$85.2B',+ revenueGrowth: -1.2,+ profitMargin: 16.8,+ beta: 0.54,+ volume: '$5.6M',+ avgVolume: '$6.1M',+ week52High: 169.23,+ week52Low: 143.45+ },+ {+ ticker: 'XOM',+ name: 'Exxon Mobil',+ sector: 'Energy',+ price: 112.45,+ change: -0.89,+ changePercent: -0.79,+ marketCap: '$456.7B',+ pe: 13.8,+ ps: 1.2,+ pb: 2.1,+ forwardPE: 12.6,+ peg: 1.5,+ dividend: 3.45,+ roe: 17.2,+ roa: 9.4,+ debtToEquity: 0.28,+ currentRatio: 1.34,+ eps: 8.15,+ revenue: '$344.6B',+ revenueGrowth: -8.9,+ profitMargin: 10.8,+ beta: 0.87,+ volume: '$12.3M',+ avgVolume: '$14.2M',+ week52High: 121.34,+ week52Low: 95.67+ },+ {+ ticker: 'TSLA',+ name: 'Tesla Inc',+ sector: 'Consumer Discretionary',+ price: 187.92,+ change: 3.45,+ changePercent: 1.87,+ marketCap: '$598.3B',+ pe: 58.9,+ ps: 7.4,+ pb: 12.3,+ forwardPE: 48.7,+ peg: 2.9,+ dividend: 0.00,+ roe: 22.4,+ roa: 8.9,+ debtToEquity: 0.17,+ currentRatio: 1.73,+ eps: 3.19,+ revenue: '$96.8B',+ revenueGrowth: 18.8,+ profitMargin: 14.4,+ beta: 2.01,+ volume: '$98.4M',+ avgVolume: '$102.3M',+ week52High: 299.29,+ week52Low: 138.80+ },+ {+ ticker: 'WMT',+ name: 'Walmart Inc',+ sector: 'Consumer Staples',+ price: 178.34,+ change: 1.23,+ changePercent: 0.69,+ marketCap: '$478.9B',+ pe: 28.7,+ ps: 0.8,+ pb: 6.9,+ forwardPE: 26.4,+ peg: 3.2,+ dividend: 1.42,+ roe: 21.8,+ roa: 6.7,+ debtToEquity: 0.56,+ currentRatio: 0.79,+ eps: 6.21,+ revenue: '$648.1B',+ revenueGrowth: 5.4,+ profitMargin: 2.4,+ beta: 0.52,+ volume: '$6.8M',+ avgVolume: '$7.3M',+ week52High: 183.45,+ week52Low: 142.67+ },+ {+ ticker: 'BA',+ name: 'Boeing Co',+ sector: 'Industrials',+ price: 189.23,+ change: -2.34,+ changePercent: -1.22,+ marketCap: '$113.4B',+ pe: -24.5,+ ps: 1.8,+ pb: -8.9,+ forwardPE: 34.2,+ peg: -1.4,+ dividend: 0.00,+ roe: -28.4,+ roa: -3.2,+ debtToEquity: 8.45,+ currentRatio: 1.12,+ eps: -7.72,+ revenue: '$77.8B',+ revenueGrowth: 10.2,+ profitMargin: -8.9,+ beta: 1.78,+ volume: '$9.8M',+ avgVolume: '$11.2M',+ week52High: 267.54,+ week52Low: 173.12+ }+ ];++ const sectors = ['ALL', 'Technology', 'Financials', 'Healthcare', 'Energy', 'Consumer Discretionary', 'Consumer Staples', 'Industrials'];++ const presetScreens = [+ { name: 'Dividend Aristocrats', desc: 'Dividend > 2%, PE < 20' },+ { name: 'Growth Stocks', desc: 'Revenue Growth > 20%, PE < 40' },+ { name: 'Value Stocks', desc: 'PE < 15, P/B < 3' },+ { name: 'Large Cap Tech', desc: 'Market Cap > $100B, Sector: Tech' },+ { name: 'High Momentum', desc: 'Beta > 1.5, 52W High < 20%' }+ ];++ const parseMarketCap = (mcap: string): number => {+ const value = parseFloat(mcap.replace(/[^0-9.]/g, ''));+ if (mcap.includes('T')) return value * 1000000;+ if (mcap.includes('B')) return value * 1000;+ if (mcap.includes('M')) return value;+ return value;+ };++ const filteredStocks = stocks.filter(stock => {+ const mcap = parseMarketCap(stock.marketCap);++ if (filters.marketCapMin && mcap < parseFloat(filters.marketCapMin)) return false;+ if (filters.marketCapMax && mcap > parseFloat(filters.marketCapMax)) return false;+ if (filters.peMin && stock.pe < parseFloat(filters.peMin)) return false;+ if (filters.peMax && stock.pe > parseFloat(filters.peMax)) return false;+ if (filters.dividendMin && stock.dividend < parseFloat(filters.dividendMin)) return false;+ if (filters.priceMin && stock.price < parseFloat(filters.priceMin)) return false;+ if (filters.priceMax && stock.price > parseFloat(filters.priceMax)) return false;+ if (filters.sector !== 'ALL' && stock.sector !== filters.sector) return false;++ return true;+ });++ const updateFilter = (key: string, value: string) => {+ setFilters({ ...filters, [key]: value });+ };++ return (+ <div style={{+ height: '100%',+ backgroundColor: COLOR_DARK_BG,+ color: COLOR_WHITE,+ fontFamily: 'Consolas, monospace',+ overflow: 'hidden',+ display: 'flex',+ flexDirection: 'column',+ fontSize: '12px'+ }}>+ {/* Header */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ borderBottom: `2px solid ${COLOR_GRAY}`,+ padding: '8px 16px',+ flexShrink: 0+ }}>+ <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>+ <span style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '16px' }}>+ STOCK SCREENER+ </span>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <span style={{ color: COLOR_CYAN }}>ADVANCED FILTERING • TECHNICAL • FUNDAMENTAL</span>+ </div>+ <div style={{ display: 'flex', alignItems: 'center', gap: '12px' }}>+ <span style={{ color: COLOR_GREEN, fontWeight: 'bold' }}>+ {filteredStocks.length} matches+ </span>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <span style={{ color: COLOR_GRAY, fontSize: '11px' }}>+ {currentTime.toLocaleTimeString()}+ </span>+ </div>+ </div>+ </div>++ {/* Main Content */}+ <div style={{ flex: 1, overflow: 'auto', display: 'flex', gap: '12px', padding: '12px' }}>+ {/* Left Panel - Filters */}+ <div style={{ width: '320px', display: 'flex', flexDirection: 'column', gap: '12px' }}>+ {/* Preset Screens */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ border: `2px solid ${COLOR_GRAY}`,+ borderLeft: `6px solid ${COLOR_PURPLE}`,+ padding: '12px'+ }}>+ <div style={{ color: COLOR_ORANGE, fontSize: '13px', fontWeight: 'bold', marginBottom: '12px' }}>+ PRESET SCREENS+ </div>+ <div style={{ display: 'flex', flexDirection: 'column', gap: '8px' }}>+ {presetScreens.map((preset, index) => (+ <div key={index}+ style={{+ padding: '10px',+ backgroundColor: 'rgba(200,100,255,0.05)',+ border: `1px solid ${COLOR_PURPLE}`,+ cursor: 'pointer'+ }}+ onMouseEnter={(e) => {+ e.currentTarget.style.backgroundColor = 'rgba(200,100,255,0.15)';+ }}+ onMouseLeave={(e) => {+ e.currentTarget.style.backgroundColor = 'rgba(200,100,255,0.05)';+ }}>+ <div style={{ color: COLOR_PURPLE, fontWeight: 'bold', fontSize: '11px', marginBottom: '4px' }}>+ {preset.name}+ </div>+ <div style={{ color: COLOR_GRAY, fontSize: '9px' }}>+ {preset.desc}+ </div>+ </div>+ ))}+ </div>+ </div>++ {/* Price Filters */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ border: `2px solid ${COLOR_GRAY}`,+ borderLeft: `6px solid ${COLOR_GREEN}`,+ padding: '12px'+ }}>+ <div style={{ color: COLOR_ORANGE, fontSize: '13px', fontWeight: 'bold', marginBottom: '12px' }}>+ PRICE FILTERS+ </div>+ <div style={{ display: 'flex', flexDirection: 'column', gap: '10px' }}>+ <div>+ <label style={{ color: COLOR_GRAY, fontSize: '10px', display: 'block', marginBottom: '4px' }}>+ Min Price ($)+ </label>+ <input+ type="number"+ value={filters.priceMin}+ onChange={(e) => updateFilter('priceMin', e.target.value)}+ style={{+ width: '100%',+ padding: '6px',+ backgroundColor: COLOR_DARK_BG,+ border: `2px solid ${COLOR_GRAY}`,+ color: COLOR_CYAN,+ fontSize: '11px',+ fontFamily: 'Consolas, monospace'+ }}+ />+ </div>+ <div>+ <label style={{ color: COLOR_GRAY, fontSize: '10px', display: 'block', marginBottom: '4px' }}>+ Max Price ($)+ </label>+ <input+ type="number"+ value={filters.priceMax}+ onChange={(e) => updateFilter('priceMax', e.target.value)}+ style={{+ width: '100%',+ padding: '6px',+ backgroundColor: COLOR_DARK_BG,+ border: `2px solid ${COLOR_GRAY}`,+ color: COLOR_CYAN,+ fontSize: '11px',+ fontFamily: 'Consolas, monospace'+ }}+ />+ </div>+ </div>+ </div>++ {/* Valuation Filters */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ border: `2px solid ${COLOR_GRAY}`,+ borderLeft: `6px solid ${COLOR_YELLOW}`,+ padding: '12px'+ }}>+ <div style={{ color: COLOR_ORANGE, fontSize: '13px', fontWeight: 'bold', marginBottom: '12px' }}>+ VALUATION FILTERS+ </div>+ <div style={{ display: 'flex', flexDirection: 'column', gap: '10px' }}>+ <div>+ <label style={{ color: COLOR_GRAY, fontSize: '10px', display: 'block', marginBottom: '4px' }}>+ Min P/E Ratio+ </label>+ <input+ type="number"+ value={filters.peMin}+ onChange={(e) => updateFilter('peMin', e.target.value)}+ style={{+ width: '100%',+ padding: '6px',+ backgroundColor: COLOR_DARK_BG,+ border: `2px solid ${COLOR_GRAY}`,+ color: COLOR_CYAN,+ fontSize: '11px',+ fontFamily: 'Consolas, monospace'+ }}+ />+ </div>+ <div>+ <label style={{ color: COLOR_GRAY, fontSize: '10px', display: 'block', marginBottom: '4px' }}>+ Max P/E Ratio+ </label>+ <input+ type="number"+ value={filters.peMax}+ onChange={(e) => updateFilter('peMax', e.target.value)}+ style={{+ width: '100%',+ padding: '6px',+ backgroundColor: COLOR_DARK_BG,+ border: `2px solid ${COLOR_GRAY}`,+ color: COLOR_CYAN,+ fontSize: '11px',+ fontFamily: 'Consolas, monospace'+ }}+ />+ </div>+ <div>+ <label style={{ color: COLOR_GRAY, fontSize: '10px', display: 'block', marginBottom: '4px' }}>+ Min Dividend Yield (%)+ </label>+ <input+ type="number"+ value={filters.dividendMin}+ onChange={(e) => updateFilter('dividendMin', e.target.value)}+ style={{+ width: '100%',+ padding: '6px',+ backgroundColor: COLOR_DARK_BG,+ border: `2px solid ${COLOR_GRAY}`,+ color: COLOR_CYAN,+ fontSize: '11px',+ fontFamily: 'Consolas, monospace'+ }}+ />+ </div>+ </div>+ </div>++ {/* Market Cap Filter */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ border: `2px solid ${COLOR_GRAY}`,+ borderLeft: `6px solid ${COLOR_CYAN}`,+ padding: '12px'+ }}>+ <div style={{ color: COLOR_ORANGE, fontSize: '13px', fontWeight: 'bold', marginBottom: '12px' }}>+ MARKET CAP ($M)+ </div>+ <div style={{ display: 'flex', flexDirection: 'column', gap: '10px' }}>+ <div>+ <label style={{ color: COLOR_GRAY, fontSize: '10px', display: 'block', marginBottom: '4px' }}>+ Min Market Cap+ </label>+ <input+ type="number"+ value={filters.marketCapMin}+ onChange={(e) => updateFilter('marketCapMin', e.target.value)}+ style={{+ width: '100%',+ padding: '6px',+ backgroundColor: COLOR_DARK_BG,+ border: `2px solid ${COLOR_GRAY}`,+ color: COLOR_CYAN,+ fontSize: '11px',+ fontFamily: 'Consolas, monospace'+ }}+ />+ </div>+ <div>+ <label style={{ color: COLOR_GRAY, fontSize: '10px', display: 'block', marginBottom: '4px' }}>+ Max Market Cap+ </label>+ <input+ type="number"+ value={filters.marketCapMax}+ onChange={(e) => updateFilter('marketCapMax', e.target.value)}+ style={{+ width: '100%',+ padding: '6px',+ backgroundColor: COLOR_DARK_BG,+ border: `2px solid ${COLOR_GRAY}`,+ color: COLOR_CYAN,+ fontSize: '11px',+ fontFamily: 'Consolas, monospace'+ }}+ />+ </div>+ </div>+ </div>++ {/* Sector Filter */}+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ border: `2px solid ${COLOR_GRAY}`,+ borderLeft: `6px solid ${COLOR_BLUE}`,+ padding: '12px'+ }}>+ <div style={{ color: COLOR_ORANGE, fontSize: '13px', fontWeight: 'bold', marginBottom: '12px' }}>+ SECTOR+ </div>+ <select+ value={filters.sector}+ onChange={(e) => updateFilter('sector', e.target.value)}+ style={{+ width: '100%',+ padding: '8px',+ backgroundColor: COLOR_DARK_BG,+ border: `2px solid ${COLOR_GRAY}`,+ color: COLOR_CYAN,+ fontSize: '11px',+ fontFamily: 'Consolas, monospace',+ fontWeight: 'bold'+ }}>+ {sectors.map(sector => (+ <option key={sector} value={sector}>{sector}</option>+ ))}+ </select>+ </div>++ {/* Clear Filters Button */}+ <button+ onClick={() => setFilters({+ marketCapMin: '',+ marketCapMax: '',+ peMin: '',+ peMax: '',+ dividendMin: '',+ priceMin: '',+ priceMax: '',+ sector: 'ALL',+ volumeMin: ''+ })}+ style={{+ padding: '12px',+ backgroundColor: COLOR_RED,+ border: 'none',+ color: COLOR_DARK_BG,+ fontSize: '12px',+ fontWeight: 'bold',+ cursor: 'pointer',+ fontFamily: 'Consolas, monospace'+ }}>+ CLEAR ALL FILTERS+ </button>+ </div>++ {/* Right Panel - Results */}+ <div style={{ flex: 1, display: 'flex', flexDirection: 'column' }}>+ <div style={{+ backgroundColor: COLOR_PANEL_BG,+ border: `2px solid ${COLOR_GRAY}`,+ flex: 1,+ overflow: 'auto'+ }}>+ {/* Table Header */}+ <div style={{+ display: 'grid',+ gridTemplateColumns: '80px 180px 120px 90px 90px 100px 70px 70px 80px 80px 80px 80px',+ padding: '10px 12px',+ backgroundColor: 'rgba(255,165,0,0.1)',+ borderBottom: `2px solid ${COLOR_ORANGE}`,+ position: 'sticky',+ top: 0,+ zIndex: 10,+ fontSize: '10px'+ }}>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold' }}>TICKER</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold' }}>NAME</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold' }}>SECTOR</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold' }}>PRICE</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold' }}>CHANGE</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold' }}>MKT CAP</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold' }}>P/E</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold' }}>P/B</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold' }}>DIV%</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold' }}>ROE%</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold' }}>REV GR%</div>+ <div style={{ color: COLOR_ORANGE, fontWeight: 'bold' }}>BETA</div>+ </div>++ {/* Table Body */}+ {filteredStocks.map((stock, index) => (+ <div key={index}+ style={{+ display: 'grid',+ gridTemplateColumns: '80px 180px 120px 90px 90px 100px 70px 70px 80px 80px 80px 80px',+ padding: '10px 12px',+ backgroundColor: index % 2 === 0 ? 'rgba(255,255,255,0.02)' : 'transparent',+ borderBottom: `1px solid ${COLOR_GRAY}`,+ cursor: 'pointer',+ fontSize: '11px'+ }}+ onMouseEnter={(e) => {+ e.currentTarget.style.backgroundColor = 'rgba(255,165,0,0.1)';+ }}+ onMouseLeave={(e) => {+ e.currentTarget.style.backgroundColor = index % 2 === 0 ? 'rgba(255,255,255,0.02)' : 'transparent';+ }}>+ <div style={{ color: COLOR_CYAN, fontWeight: 'bold' }}>{stock.ticker}</div>+ <div style={{ color: COLOR_WHITE }}>{stock.name}</div>+ <div style={{ color: COLOR_BLUE }}>{stock.sector}</div>+ <div style={{ color: COLOR_WHITE, fontWeight: 'bold' }}>${stock.price.toFixed(2)}</div>+ <div style={{ color: stock.change > 0 ? COLOR_GREEN : COLOR_RED }}>+ {stock.change > 0 ? '+' : ''}{stock.change.toFixed(2)} ({stock.changePercent.toFixed(2)}%)+ </div>+ <div style={{ color: COLOR_PURPLE }}>{stock.marketCap}</div>+ <div style={{ color: stock.pe > 0 ? COLOR_YELLOW : COLOR_RED }}>+ {stock.pe > 0 ? stock.pe.toFixed(1) : 'N/A'}+ </div>+ <div style={{ color: COLOR_CYAN }}>{stock.pb.toFixed(1)}</div>+ <div style={{ color: stock.dividend > 0 ? COLOR_GREEN : COLOR_GRAY }}>+ {stock.dividend > 0 ? stock.dividend.toFixed(2) : '-'}+ </div>+ <div style={{ color: stock.roe > 0 ? COLOR_GREEN : COLOR_RED }}>+ {stock.roe.toFixed(1)}+ </div>+ <div style={{ color: stock.revenueGrowth > 0 ? COLOR_GREEN : COLOR_RED }}>+ {stock.revenueGrowth > 0 ? '+' : ''}{stock.revenueGrowth.toFixed(1)}+ </div>+ <div style={{ color: COLOR_ORANGE }}>{stock.beta.toFixed(2)}</div>+ </div>+ ))}+ </div>+ </div>+ </div>++ {/* Footer */}+ <div style={{+ borderTop: `3px solid ${COLOR_ORANGE}`,+ backgroundColor: COLOR_PANEL_BG,+ padding: '12px 16px',+ fontSize: '11px',+ color: COLOR_WHITE,+ flexShrink: 0+ }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '8px' }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '16px' }}>+ <span style={{ color: COLOR_ORANGE, fontWeight: 'bold', fontSize: '13px' }}>+ STOCK SCREENER v1.0+ </span>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <span style={{ color: COLOR_CYAN }}>+ Advanced filtering & analysis+ </span>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <span style={{ color: COLOR_GREEN }}>+ {filteredStocks.length} stocks found+ </span>+ </div>+ </div>+ <div style={{+ display: 'flex',+ justifyContent: 'space-between',+ fontSize: '10px',+ paddingTop: '8px',+ borderTop: `1px solid ${COLOR_GRAY}`+ }}>+ <div style={{ display: 'flex', gap: '16px' }}>+ <span style={{ color: COLOR_GRAY }}><span style={{ color: COLOR_BLUE }}>F1</span> Help</span>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <span style={{ color: COLOR_GRAY }}><span style={{ color: COLOR_BLUE }}>F2</span> Save Screen</span>+ <span style={{ color: COLOR_GRAY }}>|</span>+ <span style={{ color: COLOR_GRAY }}><span style={{ color: COLOR_BLUE }}>F3</span> Export Results</span>+ </div>+ <div style={{ color: COLOR_GRAY }}>+ © 2025 Fincept Labs • All Rights Reserved+ </div>+ </div>+ </div>+ </div>+ );+};++export default ScreenerTab;\ No newline at end of filediff --git a/fincept-terminal-desktop/src/components/tabs/WatchlistTab.tsx b/fincept-terminal-desktop/src/components/tabs/WatchlistTab.tsxindex 51052a121..90278b023 100644--- a/fincept-terminal-desktop/src/components/tabs/WatchlistTab.tsx+++ b/fincept-terminal-desktop/src/components/tabs/WatchlistTab.tsx@@ -1,388 +1,667 @@import React, { useState, useEffect } from 'react';-import { Plus, Trash2, Star, TrendingUp, TrendingDown, AlertTriangle, Settings } from 'lucide-react';-interface WatchlistItem {- id: string;- symbol: string;+interface WatchlistStock {+ ticker: string;name: string;- price: string;- change: string;- changePercent: string;- volume: string;+ price: number;+ change: number;+ changePercent: number;+ volume: number;+ high: number;+ low: number;+ open: number;+ prevClose: number;marketCap: string;- pe: string;- isPositive: boolean;- isFavorite: boolean;- alerts: number;-}--interface Watchlist {- id: string;- name: string;- items: WatchlistItem[];- color: string;+ pe: number;+ yield: number;+ week52High: number;+ week52Low: number;+ avgVolume: string;}const WatchlistTab: React.FC = () => {- const [activeWatchlist, setActiveWatchlist] = useState('portfolio');- const [watchlists, setWatchlists] = useState<Record<string, Watchlist>>({- portfolio: {- id: 'portfolio',- name: 'My Portfolio',- color: 'text-green-400',- items: [- {- id: '1',- symbol: 'AAPL',- name: 'Apple Inc.',- price: '$175.43',- change: '+2.34',- changePercent: '+1.35%',- volume: '45.2M',- marketCap: '2.7T',- pe: '28.4',- isPositive: true,- isFavorite: true,- alerts: 2- },- {- id: '2',- symbol: 'MSFT',- name: 'Microsoft Corporation',- price: '$334.89',- change: '+4.12',- changePercent: '+1.24%',- volume: '28.7M',- marketCap: '2.5T',- pe: '32.1',- isPositive: true,- isFavorite: true,- alerts: 0- },- {- id: '3',- symbol: 'GOOGL',- name: 'Alphabet Inc.',- price: '$134.56',- change: '-1.23',- changePercent: '-0.91%',- volume: '32.1M',- marketCap: '1.7T',- pe: '24.8',- isPositive: false,- isFavorite: false,- alerts: 1- }- ]- },- watchlist1: {- id: 'watchlist1',- name: 'Tech Giants',- color: 'text-blue-400',- items: [- {- id: '4',- symbol: 'TSLA',- name: 'Tesla Inc.',- price: '$201.78',- change: '-5.67',- changePercent: '-2.73%',- volume: '67.4M',- marketCap: '641B',- pe: '45.6',- isPositive: false,- isFavorite: true,- alerts: 3- },- {- id: '5',- symbol: 'NVDA',- name: 'NVIDIA Corporation',- price: '$478.23',- change: '+12.45',- changePercent: '+2.67%',- volume: '52.3M',- marketCap: '1.2T',- pe: '78.9',- isPositive: true,- isFavorite: true,- alerts: 0- },- {- id: '6',- symbol: 'AMZN',- name: 'Amazon.com Inc.',- price: '$145.32',- change: '+1.89',- changePercent: '+1.32%',- volume: '41.8M',- marketCap: '1.5T',- pe: '58.3',- isPositive: true,- isFavorite: false,- alerts: 1- }- ]- },- watchlist2: {- id: 'watchlist2',- name: 'Energy Sector',- color: 'text-yellow-400',- items: [- {- id: '7',- symbol: 'XOM',- name: 'Exxon Mobil Corporation',- price: '$108.45',- change: '+2.34',- changePercent: '+2.20%',- volume: '18.5M',- marketCap: '458B',- pe: '14.2',- isPositive: true,- isFavorite: false,- alerts: 0- },- {- id: '8',- symbol: 'CVX',- name: 'Chevron Corporation',- price: '$159.78',- change: '+1.23',- changePercent: '+0.78%',- volume: '12.3M',- marketCap: '298B',- pe: '13.8',- isPositive: true,- isFavorite: false,- alerts: 1- }- ]- }- });+ const [currentTime, setCurrentTime] = useState(new Date());+ const [selectedList, setSelectedList] = useState('PRIMARY');+ const [sortBy, setSortBy] = useState('CHANGE');+ const [viewMode, setViewMode] = useState('DETAILED');- const [sortBy, setSortBy] = useState('symbol');- const [sortOrder, setSortOrder] = useState<'asc' | 'desc'>('asc');- const [lastUpdated, setLastUpdated] = useState(new Date());+ // Bloomberg color scheme+ const BLOOMBERG_ORANGE = '#FFA500';+ const BLOOMBERG_WHITE = '#FFFFFF';+ const BLOOMBERG_RED = '#FF0000';+ const BLOOMBERG_GREEN = '#00C800';+ const BLOOMBERG_YELLOW = '#FFFF00';+ const BLOOMBERG_GRAY = '#787878';+ const BLOOMBERG_BLUE = '#6496FA';+ const BLOOMBERG_PURPLE = '#C864FF';+ const BLOOMBERG_CYAN = '#00FFFF';+ const BLOOMBERG_DARK_BG = '#000000';+ const BLOOMBERG_PANEL_BG = '#0a0a0a';useEffect(() => {const timer = setInterval(() => {- setLastUpdated(new Date());- }, 5000);-+ setCurrentTime(new Date());+ }, 1000);return () => clearInterval(timer);}, []);- const currentWatchlist = watchlists[activeWatchlist];-- const toggleFavorite = (itemId: string) => {- setWatchlists(prev => ({- ...prev,- [activeWatchlist]: {- ...prev[activeWatchlist],- items: prev[activeWatchlist].items.map(item =>- item.id === itemId ? { ...item, isFavorite: !item.isFavorite } : item- )- }- }));- };-- const removeFromWatchlist = (itemId: string) => {- setWatchlists(prev => ({- ...prev,- [activeWatchlist]: {- ...prev[activeWatchlist],- items: prev[activeWatchlist].items.filter(item => item.id !== itemId)- }- }));- };-- const sortedItems = [...currentWatchlist.items].sort((a, b) => {- let aValue = a[sortBy as keyof WatchlistItem];- let bValue = b[sortBy as keyof WatchlistItem];-- if (sortBy === 'price' || sortBy === 'change') {- aValue = parseFloat(aValue.toString().replace(/[$+,%]/g, ''));- bValue = parseFloat(bValue.toString().replace(/[$+,%]/g, ''));+ const watchlistStocks: WatchlistStock[] = [+ {+ ticker: 'AAPL',+ name: 'Apple Inc.',+ price: 184.92,+ change: 1.87,+ changePercent: 1.02,+ volume: 48234567,+ high: 186.45,+ low: 182.30,+ open: 183.50,+ prevClose: 183.05,+ marketCap: '2.87T',+ pe: 29.8,+ yield: 0.52,+ week52High: 198.23,+ week52Low: 164.08,+ avgVolume: '52.3M'+ },+ {+ ticker: 'MSFT',+ name: 'Microsoft Corporation',+ price: 378.45,+ change: 3.82,+ changePercent: 1.02,+ volume: 23456789,+ high: 380.12,+ low: 374.56,+ open: 375.20,+ prevClose: 374.63,+ marketCap: '2.81T',+ pe: 35.2,+ yield: 0.78,+ week52High: 398.45,+ week52Low: 309.45,+ avgVolume: '26.8M'+ },+ {+ ticker: 'NVDA',+ name: 'NVIDIA Corporation',+ price: 501.23,+ change: 5.12,+ changePercent: 1.03,+ volume: 35678901,+ high: 505.67,+ low: 495.34,+ open: 497.80,+ prevClose: 496.11,+ marketCap: '1.24T',+ pe: 67.2,+ yield: 0.03,+ week52High: 502.66,+ week52Low: 108.13,+ avgVolume: '41.2M'+ },+ {+ ticker: 'GOOGL',+ name: 'Alphabet Inc.',+ price: 134.56,+ change: -1.23,+ changePercent: -0.91,+ volume: 28901234,+ high: 136.78,+ low: 133.45,+ open: 135.90,+ prevClose: 135.79,+ marketCap: '1.68T',+ pe: 25.4,+ yield: 0.00,+ week52High: 153.78,+ week52Low: 83.34,+ avgVolume: '31.5M'+ },+ {+ ticker: 'TSLA',+ name: 'Tesla Inc.',+ price: 251.78,+ change: -2.54,+ changePercent: -1.00,+ volume: 89012345,+ high: 256.45,+ low: 249.12,+ open: 254.30,+ prevClose: 254.32,+ marketCap: '798.4B',+ pe: 68.4,+ yield: 0.00,+ week52High: 299.29,+ week52Low: 101.81,+ avgVolume: '112.5M'+ },+ {+ ticker: 'AMZN',+ name: 'Amazon.com Inc.',+ price: 151.94,+ change: 1.45,+ changePercent: 0.96,+ volume: 45678901,+ high: 153.23,+ low: 150.12,+ open: 150.50,+ prevClose: 150.49,+ marketCap: '1.57T',+ pe: 58.9,+ yield: 0.00,+ week52High: 161.72,+ week52Low: 81.43,+ avgVolume: '51.8M'+ },+ {+ ticker: 'META',+ name: 'Meta Platforms Inc.',+ price: 389.67,+ change: 3.21,+ changePercent: 0.83,+ volume: 18234567,+ high: 392.45,+ low: 385.34,+ open: 386.50,+ prevClose: 386.46,+ marketCap: '987.3B',+ pe: 28.7,+ yield: 0.44,+ week52High: 401.82,+ week52Low: 88.09,+ avgVolume: '21.3M'+ },+ {+ ticker: 'BRK.B',+ name: 'Berkshire Hathaway Inc.',+ price: 389.45,+ change: 0.87,+ changePercent: 0.22,+ volume: 3456789,+ high: 391.23,+ low: 387.89,+ open: 388.60,+ prevClose: 388.58,+ marketCap: '854.2B',+ pe: 21.3,+ yield: 0.00,+ week52High: 404.52,+ week52Low: 298.45,+ avgVolume: '4.2M'}+ ];- const comparison = aValue < bValue ? -1 : aValue > bValue ? 1 : 0;- return sortOrder === 'asc' ? comparison : -comparison;- });+ const watchlistGroups = [+ { name: 'PRIMARY', count: 8, color: BLOOMBERG_ORANGE },+ { name: 'TECH', count: 12, color: BLOOMBERG_BLUE },+ { name: 'ENERGY', count: 6, color: BLOOMBERG_GREEN },+ { name: 'FINANCE', count: 9, color: BLOOMBERG_CYAN },+ { name: 'HEALTHCARE', count: 7, color: BLOOMBERG_PURPLE }+ ];- const handleSort = (column: string) => {- if (sortBy === column) {- setSortOrder(sortOrder === 'asc' ? 'desc' : 'asc');- } else {- setSortBy(column);- setSortOrder('asc');- }+ const marketStats = {+ gainers: 234,+ losers: 156,+ unchanged: 45,+ highVolume: 89,+ allTimeHigh: 12,+ allTimeLow: 8};return (- <div className="h-full bg-black text-white flex flex-col">- {/* Watchlist Navigation */}- <div className="bg-gray-900 border-b border-gray-700 p-2">- <div className="flex items-center justify-between">- <div className="flex gap-2">- {Object.values(watchlists).map((watchlist) => (- <button- key={watchlist.id}- onClick={() => setActiveWatchlist(watchlist.id)}- className={`px-4 py-2 text-sm font-medium rounded transition-colors ${- activeWatchlist === watchlist.id- ? 'bg-orange-600 text-white'- : 'bg-gray-800 text-gray-300 hover:bg-gray-700'- }`}- >- <span className={watchlist.color}>●</span>- <span className="ml-2">{watchlist.name}</span>- <span className="ml-1 text-xs text-gray-400">({watchlist.items.length})</span>- </button>- ))}- </div>- <button className="flex items-center gap-2 px-3 py-2 bg-orange-600 text-white text-sm font-medium rounded hover:bg-orange-700 transition-colors">- <Plus size={16} />- <span>Add Symbol</span>- </button>+ <div style={{+ height: '100%',+ backgroundColor: BLOOMBERG_DARK_BG,+ color: BLOOMBERG_WHITE,+ fontFamily: 'Consolas, monospace',+ overflow: 'hidden',+ display: 'flex',+ flexDirection: 'column',+ fontSize: '12px'+ }}>+ {/* Header */}+ <div style={{+ backgroundColor: BLOOMBERG_PANEL_BG,+ borderBottom: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '4px 8px',+ flexShrink: 0+ }}>+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px', fontSize: '13px', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_ORANGE, fontWeight: 'bold' }}>FINCEPT WATCHLIST MONITOR</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_GREEN }}>● LIVE QUOTES</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_CYAN }}>STOCKS TRACKED: {watchlistStocks.length}</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_YELLOW }}>LISTS: {watchlistGroups.length}</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_WHITE }}>{currentTime.toISOString().replace('T', ' ').substring(0, 19)} UTC</span></div>- </div>- {/* Header */}- <div className="bg-gray-800 border-b border-gray-700 p-4">- <div className="flex justify-between items-center">- <div>- <h1 className="text-xl font-bold text-orange-500">- {currentWatchlist.name.toUpperCase()}- </h1>- <div className="text-sm text-gray-400 mt-1">- {currentWatchlist.items.length} securities •- {currentWatchlist.items.filter(item => item.isPositive).length} gaining •- {currentWatchlist.items.filter(item => !item.isPositive).length} declining- </div>- </div>- <div className="flex items-center gap-4 text-sm text-gray-400">- <span>Last Updated: {lastUpdated.toLocaleTimeString()}</span>- <div className="text-green-400">● LIVE</div>- </div>+ <div style={{ display: 'flex', alignItems: 'center', gap: '8px', fontSize: '11px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>MARKET:</span>+ <span style={{ color: BLOOMBERG_GREEN }}>GAINERS {marketStats.gainers}</span>+ <span style={{ color: BLOOMBERG_RED }}>LOSERS {marketStats.losers}</span>+ <span style={{ color: BLOOMBERG_YELLOW }}>UNCHANGED {marketStats.unchanged}</span>+ <span style={{ color: BLOOMBERG_WHITE }}>|</span>+ <span style={{ color: BLOOMBERG_GRAY }}>ALERTS:</span>+ <span style={{ color: BLOOMBERG_CYAN }}>HIGH VOL {marketStats.highVolume}</span>+ <span style={{ color: BLOOMBERG_GREEN }}>52W HIGH {marketStats.allTimeHigh}</span>+ <span style={{ color: BLOOMBERG_RED }}>52W LOW {marketStats.allTimeLow}</span></div></div>- {/* Controls */}- <div className="bg-gray-900 border-b border-gray-700 p-3">- <div className="flex justify-between items-center">- <div className="flex items-center gap-4">- <span className="text-sm text-gray-400">Sort by:</span>- <select- value={sortBy}- onChange={(e) => setSortBy(e.target.value)}- className="bg-gray-800 border border-gray-600 rounded px-2 py-1 text-sm text-white"- >- <option value="symbol">Symbol</option>- <option value="price">Price</option>- <option value="change">Change</option>- <option value="changePercent">% Change</option>- <option value="volume">Volume</option>- </select>- <button- onClick={() => setSortOrder(sortOrder === 'asc' ? 'desc' : 'asc')}- className="text-sm text-orange-400 hover:text-orange-300"- >- {sortOrder === 'asc' ? '↑' : '↓'}- </button>- </div>- <div className="flex items-center gap-2">- <button className="flex items-center gap-1 px-2 py-1 bg-gray-800 text-sm text-gray-300 rounded hover:bg-gray-700">- <Settings size={14} />- <span>Settings</span>+ {/* Function Keys */}+ <div style={{+ backgroundColor: BLOOMBERG_PANEL_BG,+ borderBottom: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '2px 4px',+ flexShrink: 0+ }}>+ <div style={{ display: 'grid', gridTemplateColumns: 'repeat(12, 1fr)', gap: '2px' }}>+ {[+ { key: "F1", label: "DETAILED", view: "DETAILED" },+ { key: "F2", label: "COMPACT", view: "COMPACT" },+ { key: "F3", label: "CHARTS", view: "CHARTS" },+ { key: "F4", label: "ADD", view: "ADD" },+ { key: "F5", label: "REMOVE", view: "REMOVE" },+ { key: "F6", label: "ALERTS", view: "ALERTS" },+ { key: "F7", label: "SORT", view: "SORT" },+ { key: "F8", label: "FILTER", view: "FILTER" },+ { key: "F9", label: "IMPORT", view: "IMPORT" },+ { key: "F10", label: "EXPORT", view: "EXPORT" },+ { key: "F11", label: "SETTINGS", view: "SETTINGS" },+ { key: "F12", label: "REFRESH", view: "REFRESH" }+ ].map(item => (+ <button key={item.key}+ onClick={() => setViewMode(item.view)}+ style={{+ backgroundColor: viewMode === item.view ? BLOOMBERG_ORANGE : BLOOMBERG_DARK_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ color: viewMode === item.view ? BLOOMBERG_DARK_BG : BLOOMBERG_WHITE,+ padding: '2px 4px',+ fontSize: '9px',+ height: '16px',+ display: 'flex',+ alignItems: 'center',+ justifyContent: 'center',+ fontWeight: viewMode === item.view ? 'bold' : 'normal',+ cursor: 'pointer'+ }}>+ <span style={{ color: BLOOMBERG_YELLOW }}>{item.key}:</span>+ <span style={{ marginLeft: '2px' }}>{item.label}</span></button>- </div>+ ))}</div></div>- {/* Table Header */}- <div className="bg-gray-900 border-b border-gray-700 p-3">- <div className="grid grid-cols-9 gap-4 text-sm font-semibold text-gray-300">- <div className="cursor-pointer hover:text-white" onClick={() => handleSort('symbol')}>- SYMBOL- </div>- <div>NAME</div>- <div className="text-right cursor-pointer hover:text-white" onClick={() => handleSort('price')}>- PRICE- </div>- <div className="text-right cursor-pointer hover:text-white" onClick={() => handleSort('change')}>- CHANGE- </div>- <div className="text-right cursor-pointer hover:text-white" onClick={() => handleSort('changePercent')}>- % CHANGE- </div>- <div className="text-right cursor-pointer hover:text-white" onClick={() => handleSort('volume')}>- VOLUME+ {/* Main Content */}+ <div style={{ flex: 1, overflow: 'auto', padding: '4px', backgroundColor: '#050505' }}>+ <div style={{ display: 'flex', gap: '4px', height: '100%' }}>++ {/* Left Panel - Watchlist Groups */}+ <div style={{+ width: '280px',+ backgroundColor: BLOOMBERG_PANEL_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '4px',+ overflow: 'auto'+ }}>+ <div style={{ color: BLOOMBERG_ORANGE, fontSize: '11px', fontWeight: 'bold', marginBottom: '4px' }}>+ WATCHLIST GROUPS+ </div>+ <div style={{ borderBottom: `1px solid ${BLOOMBERG_GRAY}`, marginBottom: '8px' }}></div>++ {watchlistGroups.map((group, index) => (+ <button key={index}+ onClick={() => setSelectedList(group.name)}+ style={{+ width: '100%',+ display: 'flex',+ justifyContent: 'space-between',+ padding: '6px',+ marginBottom: '3px',+ backgroundColor: selectedList === group.name ? 'rgba(255,165,0,0.1)' : 'rgba(255,255,255,0.02)',+ border: `1px solid ${selectedList === group.name ? BLOOMBERG_ORANGE : 'transparent'}`,+ textAlign: 'left',+ cursor: 'pointer',+ fontSize: '10px'+ }}>+ <span style={{ color: group.color, fontWeight: 'bold' }}>{group.name}</span>+ <span style={{ color: BLOOMBERG_CYAN }}>{group.count} stocks</span>+ </button>+ ))}++ <div style={{ borderTop: `1px solid ${BLOOMBERG_GRAY}`, marginTop: '12px', paddingTop: '8px' }}>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '10px', fontWeight: 'bold', marginBottom: '4px' }}>+ MARKET MOVERS+ </div>+ {[+ { ticker: 'NVDA', change: '+5.12%', type: 'GAINER', color: BLOOMBERG_GREEN },+ { ticker: 'META', change: '+3.21%', type: 'GAINER', color: BLOOMBERG_GREEN },+ { ticker: 'TSLA', change: '-2.54%', type: 'LOSER', color: BLOOMBERG_RED },+ { ticker: 'GOOGL', change: '-1.23%', type: 'LOSER', color: BLOOMBERG_RED }+ ].map((mover, index) => (+ <div key={index} style={{+ display: 'flex',+ justifyContent: 'space-between',+ padding: '3px',+ marginBottom: '2px',+ backgroundColor: 'rgba(255,255,255,0.02)',+ fontSize: '9px'+ }}>+ <div>+ <span style={{ color: BLOOMBERG_CYAN }}>{mover.ticker}</span>+ <span style={{ color: BLOOMBERG_GRAY, marginLeft: '4px', fontSize: '8px' }}>[{mover.type}]</span>+ </div>+ <span style={{ color: mover.color, fontWeight: 'bold' }}>{mover.change}</span>+ </div>+ ))}+ </div>++ <div style={{ borderTop: `1px solid ${BLOOMBERG_GRAY}`, marginTop: '12px', paddingTop: '8px' }}>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '10px', fontWeight: 'bold', marginBottom: '4px' }}>+ VOLUME LEADERS+ </div>+ {[+ { ticker: 'TSLA', volume: '89.0M', pctAvg: '+179%' },+ { ticker: 'AAPL', volume: '48.2M', pctAvg: '-8%' },+ { ticker: 'AMZN', volume: '45.7M', pctAvg: '-12%' },+ { ticker: 'NVDA', volume: '35.7M', pctAvg: '-13%' }+ ].map((stock, index) => (+ <div key={index} style={{+ display: 'flex',+ justifyContent: 'space-between',+ padding: '3px',+ marginBottom: '2px',+ backgroundColor: 'rgba(255,255,255,0.02)',+ fontSize: '9px'+ }}>+ <span style={{ color: BLOOMBERG_CYAN }}>{stock.ticker}</span>+ <div style={{ textAlign: 'right' }}>+ <div style={{ color: BLOOMBERG_WHITE }}>{stock.volume}</div>+ <div style={{ color: stock.pctAvg.startsWith('+') ? BLOOMBERG_GREEN : BLOOMBERG_RED, fontSize: '8px' }}>+ {stock.pctAvg}+ </div>+ </div>+ </div>+ ))}+ </div>++ <div style={{ borderTop: `1px solid ${BLOOMBERG_GRAY}`, marginTop: '12px', paddingTop: '8px' }}>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '10px', fontWeight: 'bold', marginBottom: '4px' }}>+ QUICK ACTIONS+ </div>+ {[+ { label: 'Add Stock', color: BLOOMBERG_GREEN },+ { label: 'Create List', color: BLOOMBERG_BLUE },+ { label: 'Set Alert', color: BLOOMBERG_YELLOW },+ { label: 'Import CSV', color: BLOOMBERG_CYAN },+ { label: 'Export Data', color: BLOOMBERG_PURPLE }+ ].map((action, index) => (+ <button key={index} style={{+ width: '100%',+ padding: '4px',+ marginBottom: '2px',+ backgroundColor: 'rgba(255,255,255,0.02)',+ border: `1px solid ${BLOOMBERG_GRAY}`,+ color: action.color,+ fontSize: '9px',+ cursor: 'pointer',+ textAlign: 'left'+ }}>+ {action.label}+ </button>+ ))}+ </div></div>- <div className="text-right">MKT CAP</div>- <div className="text-right">P/E</div>- <div className="text-center">ACTIONS</div>- </div>- </div>- {/* Watchlist Items */}- <div className="flex-1 overflow-y-auto">- <div className="p-3 space-y-1">- {sortedItems.map((item) => (- <div- key={item.id}- className="grid grid-cols-9 gap-4 py-3 px-2 rounded hover:bg-gray-900 transition-colors border-b border-gray-800"- >- <div className="flex items-center gap-2">- <span className="font-semibold text-white">{item.symbol}</span>- {item.alerts > 0 && (- <div className="flex items-center gap-1">- <AlertTriangle size={14} className="text-yellow-400" />- <span className="text-xs text-yellow-400">{item.alerts}</span>+ {/* Center Panel - Stock List */}+ <div style={{+ flex: 1,+ backgroundColor: BLOOMBERG_PANEL_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '4px',+ overflow: 'auto'+ }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: '4px' }}>+ <div style={{ color: BLOOMBERG_ORANGE, fontSize: '11px', fontWeight: 'bold' }}>+ WATCHLIST: {selectedList}+ </div>+ <div style={{ display: 'flex', gap: '4px', fontSize: '9px' }}>+ <button onClick={() => setSortBy('TICKER')} style={{+ padding: '2px 6px',+ backgroundColor: sortBy === 'TICKER' ? BLOOMBERG_ORANGE : BLOOMBERG_DARK_BG,+ color: sortBy === 'TICKER' ? BLOOMBERG_DARK_BG : BLOOMBERG_WHITE,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ cursor: 'pointer'+ }}>TICKER</button>+ <button onClick={() => setSortBy('CHANGE')} style={{+ padding: '2px 6px',+ backgroundColor: sortBy === 'CHANGE' ? BLOOMBERG_ORANGE : BLOOMBERG_DARK_BG,+ color: sortBy === 'CHANGE' ? BLOOMBERG_DARK_BG : BLOOMBERG_WHITE,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ cursor: 'pointer'+ }}>CHANGE</button>+ <button onClick={() => setSortBy('VOLUME')} style={{+ padding: '2px 6px',+ backgroundColor: sortBy === 'VOLUME' ? BLOOMBERG_ORANGE : BLOOMBERG_DARK_BG,+ color: sortBy === 'VOLUME' ? BLOOMBERG_DARK_BG : BLOOMBERG_WHITE,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ cursor: 'pointer'+ }}>VOLUME</button>+ </div>+ </div>+ <div style={{ borderBottom: `1px solid ${BLOOMBERG_GRAY}`, marginBottom: '8px' }}></div>++ {/* Table Header */}+ <div style={{+ display: 'grid',+ gridTemplateColumns: '80px 200px 90px 90px 90px 90px 90px 90px',+ gap: '4px',+ padding: '4px',+ backgroundColor: 'rgba(255,255,255,0.05)',+ fontSize: '9px',+ fontWeight: 'bold',+ marginBottom: '2px'+ }}>+ <div style={{ color: BLOOMBERG_GRAY }}>TICKER</div>+ <div style={{ color: BLOOMBERG_GRAY }}>NAME</div>+ <div style={{ color: BLOOMBERG_GRAY }}>PRICE</div>+ <div style={{ color: BLOOMBERG_GRAY }}>CHANGE</div>+ <div style={{ color: BLOOMBERG_GRAY }}>VOLUME</div>+ <div style={{ color: BLOOMBERG_GRAY }}>HIGH/LOW</div>+ <div style={{ color: BLOOMBERG_GRAY }}>MKT CAP</div>+ <div style={{ color: BLOOMBERG_GRAY }}>P/E</div>+ </div>++ {/* Stock Rows */}+ {watchlistStocks.map((stock, index) => (+ <div key={index} style={{+ display: 'grid',+ gridTemplateColumns: '80px 200px 90px 90px 90px 90px 90px 90px',+ gap: '4px',+ padding: '6px 4px',+ backgroundColor: index % 2 === 0 ? 'rgba(255,255,255,0.02)' : 'transparent',+ borderLeft: `3px solid ${stock.change >= 0 ? BLOOMBERG_GREEN : BLOOMBERG_RED}`,+ fontSize: '10px',+ marginBottom: '1px'+ }}>+ <div style={{ color: BLOOMBERG_CYAN, fontWeight: 'bold' }}>{stock.ticker}</div>+ <div style={{ color: BLOOMBERG_WHITE, overflow: 'hidden', textOverflow: 'ellipsis' }}>{stock.name}</div>+ <div style={{ color: BLOOMBERG_WHITE, fontWeight: 'bold' }}>${stock.price.toFixed(2)}</div>+ <div>+ <div style={{ color: stock.change >= 0 ? BLOOMBERG_GREEN : BLOOMBERG_RED }}>+ {stock.change >= 0 ? '+' : ''}{stock.change.toFixed(2)}</div>- )}+ <div style={{ color: stock.change >= 0 ? BLOOMBERG_GREEN : BLOOMBERG_RED, fontSize: '8px' }}>+ ({stock.changePercent >= 0 ? '+' : ''}{stock.changePercent.toFixed(2)}%)+ </div>+ </div>+ <div style={{ color: BLOOMBERG_YELLOW }}>{(stock.volume / 1000000).toFixed(1)}M</div>+ <div style={{ fontSize: '9px' }}>+ <div style={{ color: BLOOMBERG_GREEN }}>${stock.high.toFixed(2)}</div>+ <div style={{ color: BLOOMBERG_RED }}>${stock.low.toFixed(2)}</div>+ </div>+ <div style={{ color: BLOOMBERG_CYAN }}>{stock.marketCap}</div>+ <div style={{ color: BLOOMBERG_WHITE }}>{stock.pe.toFixed(1)}</div></div>- <div className="text-sm text-gray-300 truncate">{item.name}</div>- <div className="text-right font-mono">{item.price}</div>- <div className={`text-right font-mono ${item.isPositive ? 'text-green-400' : 'text-red-400'}`}>- {item.change}+ ))}+ </div>++ {/* Right Panel - Stock Details */}+ <div style={{+ width: '320px',+ backgroundColor: BLOOMBERG_PANEL_BG,+ border: `1px solid ${BLOOMBERG_GRAY}`,+ padding: '4px',+ overflow: 'auto'+ }}>+ <div style={{ color: BLOOMBERG_ORANGE, fontSize: '11px', fontWeight: 'bold', marginBottom: '4px' }}>+ STOCK DETAIL: {watchlistStocks[0].ticker}+ </div>+ <div style={{ borderBottom: `1px solid ${BLOOMBERG_GRAY}`, marginBottom: '8px' }}></div>++ {/* Price Info */}+ <div style={{ marginBottom: '12px' }}>+ <div style={{ padding: '6px', backgroundColor: 'rgba(255,165,0,0.1)', marginBottom: '4px' }}>+ <div style={{ color: BLOOMBERG_GRAY, fontSize: '9px', marginBottom: '2px' }}>LAST PRICE</div>+ <div style={{ color: BLOOMBERG_WHITE, fontSize: '20px', fontWeight: 'bold' }}>+ ${watchlistStocks[0].price.toFixed(2)}+ </div>+ <div style={{ color: watchlistStocks[0].change >= 0 ? BLOOMBERG_GREEN : BLOOMBERG_RED, fontSize: '12px' }}>+ {watchlistStocks[0].change >= 0 ? '+' : ''}{watchlistStocks[0].change.toFixed(2)} (+ {watchlistStocks[0].changePercent >= 0 ? '+' : ''}{watchlistStocks[0].changePercent.toFixed(2)}%)+ </div>+ </div>+ </div>++ {/* Trading Stats */}+ <div style={{ fontSize: '9px', lineHeight: '1.5', marginBottom: '12px' }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Open:</span>+ <span style={{ color: BLOOMBERG_WHITE }}>${watchlistStocks[0].open.toFixed(2)}</span></div>- <div className={`text-right font-mono flex items-center justify-end gap-1 ${item.isPositive ? 'text-green-400' : 'text-red-400'}`}>- {item.isPositive ? <TrendingUp size={14} /> : <TrendingDown size={14} />}- {item.changePercent}+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Prev Close:</span>+ <span style={{ color: BLOOMBERG_WHITE }}>${watchlistStocks[0].prevClose.toFixed(2)}</span></div>- <div className="text-right text-gray-400">{item.volume}</div>- <div className="text-right text-gray-400">{item.marketCap}</div>- <div className="text-right text-gray-400">{item.pe}</div>- <div className="flex justify-center items-center gap-2">- <button- onClick={() => toggleFavorite(item.id)}- className={`p-1 rounded transition-colors ${- item.isFavorite ? 'text-yellow-400 hover:text-yellow-300' : 'text-gray-400 hover:text-yellow-400'- }`}- >- <Star size={14} fill={item.isFavorite ? 'currentColor' : 'none'} />- </button>- <button- onClick={() => removeFromWatchlist(item.id)}- className="p-1 text-gray-400 hover:text-red-400 transition-colors"- >- <Trash2 size={14} />- </button>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Day High:</span>+ <span style={{ color: BLOOMBERG_GREEN }}>${watchlistStocks[0].high.toFixed(2)}</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Day Low:</span>+ <span style={{ color: BLOOMBERG_RED }}>${watchlistStocks[0].low.toFixed(2)}</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>52W High:</span>+ <span style={{ color: BLOOMBERG_GREEN }}>${watchlistStocks[0].week52High.toFixed(2)}</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>52W Low:</span>+ <span style={{ color: BLOOMBERG_RED }}>${watchlistStocks[0].week52Low.toFixed(2)}</span>+ </div>+ <div style={{ borderTop: `1px solid ${BLOOMBERG_GRAY}`, marginTop: '4px', paddingTop: '4px' }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Volume:</span>+ <span style={{ color: BLOOMBERG_YELLOW }}>{(watchlistStocks[0].volume / 1000000).toFixed(1)}M</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Avg Volume:</span>+ <span style={{ color: BLOOMBERG_CYAN }}>{watchlistStocks[0].avgVolume}</span>+ </div></div></div>- ))}++ <div style={{ borderTop: `1px solid ${BLOOMBERG_GRAY}`, paddingTop: '8px', marginBottom: '8px' }}>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '10px', fontWeight: 'bold', marginBottom: '4px' }}>+ FUNDAMENTAL DATA+ </div>+ <div style={{ fontSize: '9px', lineHeight: '1.5' }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Market Cap:</span>+ <span style={{ color: BLOOMBERG_WHITE }}>{watchlistStocks[0].marketCap}</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>P/E Ratio:</span>+ <span style={{ color: BLOOMBERG_CYAN }}>{watchlistStocks[0].pe.toFixed(2)}</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Dividend Yield:</span>+ <span style={{ color: BLOOMBERG_GREEN }}>{watchlistStocks[0].yield.toFixed(2)}%</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '2px' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>EPS (TTM):</span>+ <span style={{ color: BLOOMBERG_WHITE }}>$6.42</span>+ </div>+ <div style={{ display: 'flex', justifyContent: 'space-between' }}>+ <span style={{ color: BLOOMBERG_GRAY }}>Beta:</span>+ <span style={{ color: BLOOMBERG_YELLOW }}>1.23</span>+ </div>+ </div>+ </div>++ <div style={{ borderTop: `1px solid ${BLOOMBERG_GRAY}`, paddingTop: '8px' }}>+ <div style={{ color: BLOOMBERG_YELLOW, fontSize: '10px', fontWeight: 'bold', marginBottom: '4px' }}>+ PRICE ALERTS+ </div>+ {[+ { type: 'ABOVE', price: 190.00, status: 'ACTIVE', color: BLOOMBERG_GREEN },+ { type: 'BELOW', price: 175.00, status: 'ACTIVE', color: BLOOMBERG_RED },+ { type: 'TARGET', price: 200.00, status: 'PENDING', color: BLOOMBERG_YELLOW }+ ].map((alert, index) => (+ <div key={index} style={{+ marginBottom: '4px',+ padding: '4px',+ backgroundColor: 'rgba(255,255,255,0.02)',+ borderLeft: `2px solid ${alert.color}`,+ fontSize: '9px'+ }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', marginBottom: '1px' }}>+ <span style={{ color: alert.color, fontWeight: 'bold' }}>[{alert.type}]</span>+ <span style={{ color: BLOOMBERG_GRAY }}>{alert.status}</span>+ </div>+ <div style={{ color: BLOOMBERG_WHITE }}>Target: ${alert.price.toFixed(2)}</div>+ </div>+ ))}++ <button style={{+ width: '100%',+ marginTop: '6px',+ padding: '4px',+ backgroundColor: 'rgba(255,165,0,0.1)',+ border: `1px solid ${BLOOMBERG_ORANGE}`,+ color: BLOOMBERG_ORANGE,+ fontSize: '9px',+ cursor: 'pointer'+ }}>+ + CREATE NEW ALERT+ </button>+ </div>+ </div></div></div>- {/* Footer */}- <div className="bg-gray-900 border-t border-gray-700 p-3">- <div className="flex justify-between items-center text-sm">- <div className="text-gray-400">- Portfolio Value: $1,234,567.89 | Daily P&L: +$23,456.78 (+1.89%)+ {/* Status Bar */}+ <div style={{+ borderTop: `1px solid ${BLOOMBERG_GRAY}`,+ backgroundColor: BLOOMBERG_PANEL_BG,+ padding: '2px 8px',+ fontSize: '10px',+ color: BLOOMBERG_GRAY,+ flexShrink: 0+ }}>+ <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>+ <div style={{ display: 'flex', gap: '16px' }}>+ <span>Fincept Watchlist Monitor v1.8.2 | Real-time market data</span>+ <span>Tracking: {watchlistStocks.length} stocks | Lists: {watchlistGroups.length}</span></div>- <div className="text-gray-400">- Auto-refresh: 5s+ <div style={{ display: 'flex', gap: '16px' }}>+ <span>List: {selectedList}</span>+ <span>Sort: {sortBy}</span>+ <span style={{ color: BLOOMBERG_GREEN }}>QUOTES: LIVE</span></div></div></div>