import { View, Text } from 'react-native'; import { Ionicons } from '@expo/vector-icons'; import { useColors } from '../../lib/theme'; export type CooldownEntry = { id: string; startedAt: string; durationLabel: string; status: 'active' | 'resolved' | 'cancelled'; reason: string | null; }; type Props = { currentDays: number; longestDays: number; startDate: string; cooldowns: CooldownEntry[]; }; const statusLabel: Record = { active: 'aktiv', resolved: 'beendet', cancelled: 'abgebrochen', }; const statusColor: Record = { active: { bg: '#fff7ed', text: '#c2410c' }, resolved: { bg: '#f0fdf4', text: '#15803d' }, cancelled: { bg: '#f5f5f5', text: '#737373' }, }; export function StreakSection({ currentDays, longestDays, startDate, cooldowns }: Props) { const colors = useColors(); return ( STREAK {currentDays} Tage geschützt seit {startDate} Längste Streak: {longestDays} Tage {cooldowns.length > 0 ? ( COOLDOWN-VERLAUF {cooldowns.map((c, idx) => { const isLast = idx === cooldowns.length - 1; const colorPair = statusColor[c.status]; return ( {!isLast ? ( ) : null} {c.startedAt} {c.durationLabel} {statusLabel[c.status].toUpperCase()} {c.reason ? ( {c.reason} ) : null} ); })} ) : null} ); }