import React from 'react'; import { View, Text, StyleSheet, ScrollView } from 'react-native'; import { useTheme } from '~/features/theme/ThemeProvider'; import { useTranslation } from 'react-i18next'; import { useRouter } from 'expo-router'; import GlassCard from './GlassCard'; import StatRow from './StatRow'; import ClickableStatRow from './ClickableStatRow'; interface EngagementCardProps { mostViewedMemo: { id: string; title: string; viewCount: number } | null; lastViewedMemo: { id: string; title: string; lastViewed: string } | null; unreadMemos: number; memoCount: number; } const EngagementCard: React.FC = ({ mostViewedMemo, lastViewedMemo, unreadMemos, memoCount, }) => { const { isDark } = useTheme(); const { t } = useTranslation(); const router = useRouter(); const textColor = isDark ? '#FFFFFF' : '#000000'; const sectionTitleColor = isDark ? '#CCCCCC' : '#666666'; // Calculate read percentage const readMemos = memoCount - unreadMemos; const readPercentage = memoCount > 0 ? Math.round((readMemos / memoCount) * 100) : 0; return ( Engagement {/* View Statistics */} {t('statistics.section_engagement') || 'Aufrufe'} {mostViewedMemo && ( router.push(`/(protected)/(memo)/${mostViewedMemo.id}`)} /> )} {lastViewedMemo && ( router.push(`/(protected)/(memo)/${lastViewedMemo.id}`)} /> )} {/* Reading Statistics */} Lesestatus {unreadMemos > 0 && ( <> 💡 Du hast noch {unreadMemos} ungelesene{' '} {unreadMemos === 1 ? 'Memo' : 'Memos'} )} ); }; const styles = StyleSheet.create({ title: { fontSize: 26, fontWeight: '700', marginBottom: 20, }, sectionTitle: { fontSize: 15, fontWeight: '600', marginBottom: 10, marginTop: 4, textTransform: 'uppercase', letterSpacing: 0.5, }, statsContainer: { gap: 6, }, divider: { height: 0, marginVertical: 18, }, hintContainer: { backgroundColor: 'rgba(255, 255, 255, 0.05)', borderRadius: 12, padding: 14, }, hintText: { fontSize: 13, lineHeight: 18, }, }); export default EngagementCard;