import { useState } from 'react' import { PieChart, Pie, Cell, ResponsiveContainer, LineChart, Line, XAxis } from 'recharts' import { Plus, Server, Activity, AlertTriangle, DollarSign, Globe2 } from 'lucide-react' const subTabs = ['Overview'] const statusCards = [ { label: 'Total Resources', value: '128', icon: Server, sub: '+4 this week' }, { label: 'Healthy', value: '124', icon: Activity, sub: '96.9%', color: '#2ECC71' }, { label: 'Warnings', value: '3', icon: AlertTriangle, sub: 'Needs attention', color: '#E67E22' }, { label: 'Critical', value: '1', icon: AlertTriangle, sub: 'Action required', color: '#E74C3C' }, { label: 'Monthly Cost', value: '$24,560.75', icon: DollarSign, sub: '↑ 3.2% MTD' }, ] const costData = [ { name: 'Compute', value: 38, color: '#C8A434' }, { name: 'Storage', value: 22, color: '#E67E22' }, { name: 'Database', value: 25, color: '#2ECC71' }, { name: 'Network', value: 15, color: '#7A7D85' }, ] const regions = [ { name: 'us-east-1', x: '22%', y: '38%', resources: 42 }, { name: 'us-west-2', x: '12%', y: '42%', resources: 18 }, { name: 'eu-west-1', x: '48%', y: '30%', resources: 31 }, { name: 'ap-southeast-1', x: '78%', y: '58%', resources: 22 }, { name: 'sa-east-1', x: '32%', y: '72%', resources: 9 }, { name: 'ap-northeast-1', x: '85%', y: '40%', resources: 6 }, ] const trendData = Array.from({ length: 14 }, (_, i) => ({ day: i, compute: 60 + i * 0.6 + Math.sin(i / 2) * 3, storage: 35 + i * 0.4 + Math.cos(i / 3) * 2, database: 20 + i * 0.2 + Math.sin(i / 4) * 1.5, })) const activities = [ { title: 'Auto-scaling triggered', source: 'App Server Group', time: '4m ago' }, { title: 'Resource provisioned', source: 'db-replica-02', time: '19m ago' }, { title: 'Health check failed', source: 'cache-cluster-02', time: '27m ago' }, { title: 'Tag updated', source: '12 resources', time: '1h ago' }, ] const cardBase: React.CSSProperties = { backgroundColor: 'rgba(10, 10, 12, 0.92)', border: '1px solid rgba(200, 164, 52, 0.08)', borderRadius: '12px', padding: '20px', boxShadow: '0 0 20px rgba(200, 164, 52, 0.03)', transition: 'border-color 0.2s ease', position: 'relative', overflow: 'hidden', height: '100%', display: 'flex', flexDirection: 'column', } const sectionTitle: React.CSSProperties = { fontSize: '11px', textTransform: 'uppercase', letterSpacing: '1.5px', color: '#7A7D85', fontWeight: 500, marginBottom: '16px', } function framedCard(bgUrl: string): React.CSSProperties { return { backgroundImage: `url(${bgUrl})`, backgroundSize: '100% 100%', backgroundPosition: 'center', backgroundRepeat: 'no-repeat', position: 'relative', overflow: 'hidden', height: '100%', display: 'flex', flexDirection: 'column', padding: '20px 20px 64px 20px', } } const cardVignette: React.CSSProperties = { position: 'absolute', inset: 0, pointerEvents: 'none', background: 'radial-gradient(ellipse closest-side at center, transparent 70%, var(--color-page) 100%)', } const distributionData = [ { name: 'Compute', value: 42, color: '#C8A434' }, { name: 'Storage', value: 28, color: '#E67E22' }, { name: 'Database', value: 18, color: '#2ECC71' }, { name: 'Network', value: 12, color: '#7A7D85' }, ] function Donut({ data, centerLabel }: { data: { name: string; value: number; color: string }[]; centerLabel?: string }) { return (
{card.sub}
{item.title}
{item.source}