import { useState } from 'react'; import { Cpu, MemoryStick, Zap, Users, Activity, TrendingUp, Database } from 'lucide-react'; import { LineChart, LineAreaChart, MultiLineChart, DonutChart, BarChart, EnhancedMetricCard, CacheMetricCard, PerformanceMetricCard, useToast } from '@/shared/components'; // Sample data const sampleLineData = [12, 19, 15, 25, 22, 30, 28, 35, 32, 38, 35, 42, 38, 45, 42, 48, 45, 52, 48, 55, 52, 58, 55, 60]; const sampleAreaData = [40, 45, 42, 50, 48, 55, 52, 60, 58, 65, 62, 70, 68, 75, 72]; const sampleBarData = [20, 35, 28, 45, 38, 52, 48, 60, 55, 68, 62, 75, 70, 82, 78, 88, 85, 92, 88, 95, 92, 98, 95, 100]; export function ComponentShowcase() { const { showToast } = useToast(); const [activeTab, setActiveTab] = useState<'charts' | 'cards' | 'ui'>('charts'); const handleCardClick = (name: string) => { showToast(`${name} clicked!`, 'info'); }; return (
{/* Header */}

Component Showcase

Production-grade components matching self.html design

{/* Tabs */}
{/* Charts Tab */} {activeTab === 'charts' && (

Line Charts

Basic Line Chart (CPU Style)

Line Chart (No Dots)

Area Charts

Area Chart (Active Users Style)

Area Chart (Success Color)

Multi-Line & Bar Charts

Multi-Line Chart (Performance Style)

v + 10), color: 'var(--accent-primary)', fillOpacity: 0.15 }, { data: sampleLineData, color: 'var(--warning)', fillOpacity: 0.15 } ]} height={120} />

Bar Chart (Timeline Style)

Donut Charts

RAM Usage (65%)

Disk Usage (82%)

Network (45%)

)} {/* Metric Cards Tab */} {activeTab === 'cards' && (

Standard Metric Cards

} chart={} onClick={() => handleCardClick('CPU Usage')} animationDelay={0.04} /> } chart={ v + 20)} color="var(--warning)" height={76} />} onClick={() => handleCardClick('Memory')} animationDelay={0.09} /> } chart={} onClick={() => handleCardClick('Requests')} animationDelay={0.14} />

Horizontal Layout Cards

} chart={} details={
{['🇨🇳', '🇮🇩', '🇲🇲', '🇲🇾', '🇯🇵', '🇮🇳', '🇰🇷', '🇵🇭'].map((flag, i) => ( {flag} ))}
} horizontal onClick={() => handleCardClick('Active Users')} animationDelay={0.04} /> } chart={ v + 10)} color="var(--accent-primary)" height={130} />} details={
Read: 8.2K
Write: 4.3K
} horizontal onClick={() => handleCardClick('Database Queries')} animationDelay={0.09} />

Specialized Cards

handleCardClick('Cache')} animationDelay={0.04} /> v + 20), color: 'var(--accent-primary)', fillOpacity: 0.15 }, { data: sampleLineData.map(v => v + 10), color: 'var(--warning)', fillOpacity: 0.15 } ]} onClick={() => handleCardClick('Performance')} animationDelay={0.09} />
)} {/* UI Elements Tab */} {activeTab === 'ui' && (

Badges & Indicators

Active Stopped
Healthy
Degraded
Critical

Buttons

Pills & Tabs

Pill Group

Day
Month
Year

Tabs

Search & Input

Toast Notifications

)}
); }