import React from 'react'; import { View, Pressable } from 'react-native'; import { Icon } from '../ui/Icon'; import { Text } from '../ui/Text'; import { Card } from '../ui/Card'; import { DeckProgress } from '../../store/progressStore'; import { router } from 'expo-router'; import { useThemeColors } from '~/utils/themeUtils'; interface DeckProgressCardProps { progress: DeckProgress; } export const DeckProgressCard: React.FC = ({ progress }) => { const colors = useThemeColors(); const getMasteryColor = (percentage: number) => { if (percentage >= 80) return '#16a34a'; // green-600 if (percentage >= 60) return '#2563eb'; // blue-600 if (percentage >= 40) return '#ca8a04'; // yellow-600 if (percentage >= 20) return '#ea580c'; // orange-600 return colors.mutedForeground; }; const getMasteryIcon = (percentage: number) => { if (percentage >= 80) return 'trophy'; if (percentage >= 60) return 'medal'; if (percentage >= 40) return 'ribbon'; if (percentage >= 20) return 'school'; return 'book'; }; return ( router.push(`/deck/${progress.deck_id}`)} style={({ pressed }) => pressed && { opacity: 0.7 }}> {progress.deck_name} {/* Progress Bar */} {/* Stats */} {progress.mastered_cards} gemeistert {progress.learning_cards} lernen {progress.new_cards} neu {progress.completion_percentage}% {/* Ease Factor */} Schwierigkeit: {progress.average_ease_factor.toFixed(1)} ); };