import { useState } from 'react' import { PieChart, Pie, Cell, ResponsiveContainer, LineChart, Line, XAxis } from 'recharts' import { Plus, Server, Activity, AlertTriangle, DollarSign } 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 nodes = [ { name: 'web-frontend-lb', status: 'healthy' }, { name: 'app-server-01', status: 'healthy' }, { name: 'app-server-02', status: 'healthy' }, { name: 'app-server-03', status: 'warning' }, { name: 'db-primary-01', status: 'healthy' }, { name: 'db-replica-02', status: 'healthy' }, { name: 'cache-cluster-02', status: 'critical' }, { name: 'batch-worker-04', status: 'healthy' }, { name: 'storage-node-01', status: 'healthy' }, { name: 'storage-node-02', status: 'healthy' }, { name: 'monitoring-01', status: 'healthy' }, { name: 'vpn-gateway', status: 'warning' }, ] const nodeStatusColor: Record = { healthy: '#2ECC71', warning: '#E67E22', critical: '#E74C3C', } 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, network: 45 + i * 0.3 + Math.cos(i / 2.5) * 2.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 cardDim: React.CSSProperties = { position: 'absolute', inset: 0, pointerEvents: 'none', backgroundColor: 'rgba(8, 8, 10, 0.45)', } 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 (
{data.map((entry) => ( ))} {centerLabel && (
{centerLabel}
)}
{data.map((entry) => (
{entry.name} {entry.value}%
))}
) } export default function Infrastructure() { const [activeTab, setActiveTab] = useState('Overview') return ( <> {/* Sub-tabs + Add Resource — hero banner is rendered at the layout level behind this */}
{subTabs.map((tab) => { const active = tab === activeTab return ( ) })}
{/* Status Cards */}
{statusCards.map((card) => { const Icon = card.icon return (

{card.label}

{card.value}

{card.sub}

) })}
{/* Middle Row */}
{/* Resource Distribution */}

Resource Distribution

{/* Node Status — expanded */}

Node Status

{nodes.map((node) => (
{node.name}
))}
{/* Bottom Row */}
{/* Resource Trend */}

Resource Trend

{/* Cost Breakdown */}

Cost Breakdown (MTD)

{/* Recent Activity */}

Recent Activity

{activities.map((item, i) => (

{item.title}

{item.source}

{item.time}
))}
{/* Footer stats bar */}
AWS| 6 Regions| 18 AZs| 128 Resources| 98.7% Health| $24,560.75 MTD| 2 Alerts
) }