1+ import React from 'react' ;
2+ import { TrendingUp , TrendingDown , DollarSign , Target } from 'lucide-react' ;
3+
4+ export const Dashboard : React . FC = ( ) => {
5+ const metrics = [
6+ { title : 'Total Return' , value : '+23.45%' , change : '+2.1%' , icon : TrendingUp , trend : 'up' } ,
7+ { title : 'Sharpe Ratio' , value : '1.234' , change : '+0.12' , icon : TrendingUp , trend : 'up' } ,
8+ { title : 'Max Drawdown' , value : '-12.34%' , change : '-1.2%' , icon : TrendingDown , trend : 'down' } ,
9+ { title : 'Win Rate' , value : '64.50%' , change : '+3.2%' , icon : Target , trend : 'up' }
10+ ] ;
11+
12+ return (
13+ < div className = "p-8" >
14+ < div className = "mb-8" >
15+ < h1 className = "text-3xl font-bold text-gray-900" > Dashboard</ h1 >
16+ < p className = "text-gray-600 mt-2" > Welcome to your quantitative research workspace</ p >
17+ </ div >
18+
19+ { /* Metrics Grid */ }
20+ < div className = "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8" >
21+ { metrics . map ( ( metric , index ) => {
22+ const Icon = metric . icon ;
23+ return (
24+ < div key = { index } className = "bg-white rounded-xl shadow-sm border border-gray-200 p-6" >
25+ < div className = "flex items-center justify-between mb-4" >
26+ < div className = "p-2 bg-blue-50 rounded-lg" >
27+ < Icon className = { `w-6 h-6 ${
28+ metric . trend === 'up' ? 'text-green-600' : 'text-red-600'
29+ } `} />
30+ </ div >
31+ < span className = { `text-sm font-medium ${
32+ metric . trend === 'up' ? 'text-green-600' : 'text-red-600'
33+ } `} >
34+ { metric . change }
35+ </ span >
36+ </ div >
37+ < h3 className = "text-gray-600 text-sm font-medium mb-1" > { metric . title } </ h3 >
38+ < div className = { `text-2xl font-bold ${
39+ metric . trend === 'up' ? 'text-green-600' : 'text-red-600'
40+ } `} >
41+ { metric . value }
42+ </ div >
43+ </ div >
44+ ) ;
45+ } ) }
46+ </ div >
47+
48+ { /* Recent Activity */ }
49+ < div className = "grid grid-cols-1 lg:grid-cols-2 gap-8" >
50+ < div className = "bg-white rounded-xl shadow-sm border border-gray-200 p-6" >
51+ < h3 className = "text-lg font-semibold text-gray-900 mb-4" > Recent Backtests</ h3 >
52+ < div className = "space-y-4" >
53+ { [
54+ { name : 'Momentum Strategy' , date : '2 hours ago' , status : 'Completed' } ,
55+ { name : 'Mean Reversion' , date : '5 hours ago' , status : 'Completed' } ,
56+ { name : 'Sector Rotation' , date : '1 day ago' , status : 'Running' }
57+ ] . map ( ( test , index ) => (
58+ < div key = { index } className = "flex items-center justify-between p-3 bg-gray-50 rounded-lg" >
59+ < div >
60+ < div className = "font-medium text-gray-900" > { test . name } </ div >
61+ < div className = "text-sm text-gray-500" > { test . date } </ div >
62+ </ div >
63+ < span className = { `px-2 py-1 rounded-full text-xs font-medium ${
64+ test . status === 'Completed'
65+ ? 'bg-green-100 text-green-800'
66+ : 'bg-blue-100 text-blue-800'
67+ } `} >
68+ { test . status }
69+ </ span >
70+ </ div >
71+ ) ) }
72+ </ div >
73+ </ div >
74+
75+ < div className = "bg-white rounded-xl shadow-sm border border-gray-200 p-6" >
76+ < h3 className = "text-lg font-semibold text-gray-900 mb-4" > Quick Actions</ h3 >
77+ < div className = "space-y-3" >
78+ < button className = "w-full text-left p-4 bg-blue-50 border border-blue-200 rounded-lg hover:bg-blue-100 transition-colors" >
79+ < div className = "font-medium text-blue-900" > Run New Backtest</ div >
80+ < div className = "text-sm text-blue-700" > Test a new trading strategy</ div >
81+ </ button >
82+ < button className = "w-full text-left p-4 bg-green-50 border border-green-200 rounded-lg hover:bg-green-100 transition-colors" >
83+ < div className = "font-medium text-green-900" > Analyze Portfolio</ div >
84+ < div className = "text-sm text-green-700" > Deep dive into performance metrics</ div >
85+ </ button >
86+ < button className = "w-full text-left p-4 bg-purple-50 border border-purple-200 rounded-lg hover:bg-purple-100 transition-colors" >
87+ < div className = "font-medium text-purple-900" > Research Factors</ div >
88+ < div className = "text-sm text-purple-700" > Explore alpha factors</ div >
89+ </ button >
90+ </ div >
91+ </ div >
92+ </ div >
93+ </ div >
94+ ) ;
95+ } ;
0 commit comments