import React from 'react'; import { View, Text, StyleSheet } from 'react-native'; import { LinearGradient } from 'expo-linear-gradient'; import { Ionicons } from '@expo/vector-icons'; import { theme } from '../styles/theme'; interface MetricProps { title: string; value: string | number; change: string; trend: 'up' | 'down'; icon: string; colorScheme: 'blue' | 'green' | 'purple' | 'orange'; } const getColorScheme = (colorScheme: 'blue' | 'green' | 'purple' | 'orange') => { const schemes = { blue: { colors: ['#1e3a8a', '#0c4a6e'], text: '#ffffff', label: '#93c5fd', badge: '#3b82f6', badgeText: '#ffffff', icon: '#60a5fa', }, green: { colors: ['#064e3b', '#047857'], text: '#ffffff', label: '#86efac', badge: '#10b981', badgeText: '#ffffff', icon: '#34d399', }, purple: { colors: ['#581c87', '#7c3aed'], text: '#ffffff', label: '#d8b4fe', badge: '#a855f7', badgeText: '#ffffff', icon: '#c084fc', }, orange: { colors: ['#92400e', '#b45309'], text: '#ffffff', label: '#fcd34d', badge: '#f97316', badgeText: '#ffffff', icon: '#fb923c', }, }; return schemes[colorScheme]; }; const MetricCard: React.FC = ({ title, value, change, trend, icon, colorScheme }) => { const colors = getColorScheme(colorScheme); const isPositive = trend === 'up'; const trendIcon = isPositive ? 'arrow-up' : 'arrow-down'; return ( {title} {value} {trend === 'up' ? '↑' : '↓'} {change} vs month ); }; export const PerformanceMetrics: React.FC = () => { const metrics: MetricProps[] = [ { title: 'Total Users', value: '0', change: '+12%', trend: 'up', icon: 'people', colorScheme: 'blue', }, { title: 'Active Clients', value: '0', change: '+5%', trend: 'up', icon: 'person-add', colorScheme: 'green', }, { title: 'Revenue', value: '$0.00', change: '0%', trend: 'down', icon: 'wallet', colorScheme: 'purple', }, { title: 'Growth', value: '24%', change: '-2%', trend: 'down', icon: 'trending-up', colorScheme: 'orange', }, ]; return ( Performance metrics & athlete insights {metrics.map((metric, index) => ( ))} ); }; const styles = StyleSheet.create({ container: { paddingHorizontal: 20, marginBottom: 24, }, header: { marginBottom: 16, }, title: { fontSize: 14, fontWeight: '600', color: '#4b5563', letterSpacing: 0.3, }, metricsGrid: { flexDirection: 'row', flexWrap: 'wrap', justifyContent: 'space-between', gap: 12, }, metricWrapper: { width: '48%', }, card: { borderRadius: 20, overflow: 'hidden', elevation: 8, shadowColor: '#000', shadowOffset: { width: 0, height: 4 }, shadowOpacity: 0.2, shadowRadius: 12, }, cardContent: { padding: 16, minHeight: 160, justifyContent: 'space-between', }, iconContainer: { width: 36, height: 36, borderRadius: 10, justifyContent: 'center', alignItems: 'center', }, label: { fontSize: 11, fontWeight: '700', letterSpacing: 0.6, marginBottom: 12, textTransform: 'uppercase', }, value: { fontSize: 28, fontWeight: '800', marginBottom: 12, }, changeContainer: { alignItems: 'flex-start', }, trendBadge: { flexDirection: 'row', paddingHorizontal: 8, paddingVertical: 4, borderRadius: 6, alignItems: 'center', marginBottom: 6, }, changeText: { fontSize: 11, fontWeight: '700', }, compareText: { fontSize: 10, fontWeight: '500', }, });