|
| 1 | + |
| 2 | +import React, { useState } from 'react'; |
| 3 | +import { ResponsiveContainer, AreaChart, Area, XAxis, YAxis, Tooltip } from 'recharts'; |
| 4 | +import Sidebar from './Sidebar'; |
| 5 | + |
| 6 | +const chartData = [ |
| 7 | + { name: 'Week 1', value: 109 }, { name: 'Week 2', value: 21 }, |
| 8 | + { name: 'Week 3', value: 93 }, { name: 'Week 4', value: 45 }, |
| 9 | +]; |
| 10 | + |
| 11 | +const AnalysisPage: React.FC = () => { |
| 12 | + const [activeTab, setActiveTab] = useState('AI Inference'); |
| 13 | + const tabs = ['AI Inference', 'Time Series', 'Correlations', 'Ground Data']; |
| 14 | + |
| 15 | + return ( |
| 16 | + <div className="flex min-h-screen bg-background-dark"> |
| 17 | + <Sidebar /> |
| 18 | + <div className="flex-1 bg-background-darker/50"> |
| 19 | + <header className="flex items-center justify-between whitespace-nowrap border-b border-solid border-surface-accent px-10 py-3"> |
| 20 | + <h1 className="text-white text-lg font-bold">Analysis Panel</h1> |
| 21 | + <div className="flex items-center gap-4"> |
| 22 | + <button className="flex min-w-[84px] cursor-pointer items-center justify-center rounded-lg h-10 px-4 bg-primary text-background-dark text-sm font-bold hover:bg-primary/80 transition-colors"> |
| 23 | + Open in Colab |
| 24 | + </button> |
| 25 | + <div className="flex items-center gap-3"> |
| 26 | + <div className="bg-center bg-no-repeat aspect-square bg-cover rounded-full size-10" style={{ backgroundImage: `url("https://lh3.googleusercontent.com/aida-public/AB6AXuB-L3B8Q4Z2iFhq3U9TIcZcorNrIeIoN6x71tmWbZjmEvpXpdlYWOV2gqONYBig7NXwgw-o1cQBhNPWZ1M_Kae228Zfni7pYC4CsrpRAyiiTIf121kdnW1rqv7snNRGMwUd7l-305dNqK_7WSFtCR8NyMBUyP33BKbUwEIZ6nc_1qX58wRjlpx_-SAltx1LLGd64ncUel2q56vmFHkK0aaa02uykkz_Jun4YhFtgrjCPgQX5qxbaVjmO4oD_mJNUPFrQXSO1UUfWlbJ")` }}></div> |
| 27 | + <div> |
| 28 | + <h1 className="text-white text-base font-medium">Dr. Evelyn Reed</h1> |
| 29 | + <p className="text-text-secondary text-sm">Environmental Scientist</p> |
| 30 | + </div> |
| 31 | + </div> |
| 32 | + </div> |
| 33 | + </header> |
| 34 | + <main className="p-10"> |
| 35 | + <div className="flex flex-col gap-6"> |
| 36 | + <div className="border-b border-surface-accent"> |
| 37 | + <div className="flex gap-8"> |
| 38 | + {tabs.map(tab => ( |
| 39 | + <button key={tab} onClick={() => setActiveTab(tab)} className={`pb-3 pt-4 text-sm font-bold tracking-[0.015em] transition-colors border-b-[3px] ${activeTab === tab ? 'border-primary text-white' : 'border-transparent text-text-secondary hover:border-primary/50 hover:text-white'}`}> |
| 40 | + {tab} |
| 41 | + </button> |
| 42 | + ))} |
| 43 | + </div> |
| 44 | + </div> |
| 45 | + <div className="flex gap-3 flex-wrap"> |
| 46 | + <button className="flex h-8 items-center justify-center gap-x-2 rounded-lg bg-surface-accent px-4 hover:bg-surface-accent/70 transition-colors"> |
| 47 | + <p className="text-white text-sm font-medium">Date Range</p> |
| 48 | + <span className="material-symbols-outlined text-white text-base">expand_more</span> |
| 49 | + </button> |
| 50 | + <button className="flex h-8 items-center justify-center gap-x-2 rounded-lg bg-surface-accent px-4 hover:bg-surface-accent/70 transition-colors"> |
| 51 | + <p className="text-white text-sm font-medium">Location</p> |
| 52 | + <span className="material-symbols-outlined text-white text-base">expand_more</span> |
| 53 | + </button> |
| 54 | + <button className="flex h-8 items-center justify-center gap-x-2 rounded-lg bg-surface-accent px-4 hover:bg-surface-accent/70 transition-colors"> |
| 55 | + <p className="text-white text-sm font-medium">Gas Type</p> |
| 56 | + <span className="material-symbols-outlined text-white text-base">expand_more</span> |
| 57 | + </button> |
| 58 | + </div> |
| 59 | + <div className="grid grid-cols-1 lg:grid-cols-3 gap-6"> |
| 60 | + <div className="lg:col-span-2 flex flex-col gap-4 p-6 bg-surface rounded-xl"> |
| 61 | + <p className="text-white text-base font-medium">AI Inference Analysis - Anomaly Hotspots</p> |
| 62 | + <img alt="Map showing anomaly hotspots" className="w-full h-[400px] object-cover rounded-lg" src="https://lh3.googleusercontent.com/aida-public/AB6AXuA0uYqAhgUj1VlP2T0JvUQZqsRBPI17CSUJQtI4sc5PngAFXGr4CC9biIoEmKoe7aljwNPqWSZFRFdcTNpBcCjdc67IBOBwr5pVJyhSBuDTsunj_D10UKQCmrSaS0ElpJYZ0sE0yF9x0EzUe6Rhfv06C2vebMwDJ-HyPdFIjwKy9kOWjM6mAdY9MyrESGagkE-SPDNt1mGNHQXY1fiabm_HmltP9jeLBEY_gCkfeMkkeR9xDOqQqMPbm5pLn8DerEY7cy1t9a8Fsf7a" /> |
| 63 | + </div> |
| 64 | + <div className="flex flex-col gap-4 p-6 bg-surface rounded-xl"> |
| 65 | + <div className="flex flex-col gap-2"> |
| 66 | + <p className="text-white text-base font-medium">CO2 Concentration</p> |
| 67 | + <p className="text-primary text-3xl font-bold">450 ppm</p> |
| 68 | + <div className="flex gap-1"> |
| 69 | + <p className="text-text-secondary text-base">Last 30 Days</p> |
| 70 | + <p className="text-positive text-base font-medium">+5%</p> |
| 71 | + </div> |
| 72 | + </div> |
| 73 | + <div className="h-48 mt-4"> |
| 74 | + <ResponsiveContainer width="100%" height="100%"> |
| 75 | + <AreaChart data={chartData} margin={{ top: 5, right: 20, left: -20, bottom: 5 }}> |
| 76 | + <defs> |
| 77 | + <linearGradient id="chartGradient" x1="0" y1="0" x2="0" y2="1"> |
| 78 | + <stop offset="5%" stopColor="#13ecb6" stopOpacity={0.4}/> |
| 79 | + <stop offset="95%" stopColor="#13ecb6" stopOpacity={0}/> |
| 80 | + </linearGradient> |
| 81 | + </defs> |
| 82 | + <XAxis dataKey="name" stroke="#9db9b2" fontSize={12} tickLine={false} axisLine={false} /> |
| 83 | + <Tooltip contentStyle={{ backgroundColor: '#111816', border: '1px solid #13ecb6' }} /> |
| 84 | + <Area type="monotone" dataKey="value" stroke="#13ecb6" strokeWidth={3} fill="url(#chartGradient)" /> |
| 85 | + </AreaChart> |
| 86 | + </ResponsiveContainer> |
| 87 | + </div> |
| 88 | + </div> |
| 89 | + </div> |
| 90 | + </div> |
| 91 | + </main> |
| 92 | + </div> |
| 93 | + </div> |
| 94 | + ); |
| 95 | +}; |
| 96 | + |
| 97 | +export default AnalysisPage; |
0 commit comments