import React from 'react'; import { View, Text, StyleSheet, ScrollView } from 'react-native'; import { useTheme } from '~/features/theme/ThemeProvider'; import { useTranslation } from 'react-i18next'; import GlassCard from './GlassCard'; import StatRow from './StatRow'; import WeekdayChart from './WeekdayChart'; import { formatDurationWithUnits } from '~/utils/formatters'; interface InsightsCardProps { averageAudioDuration: number; averageWordsPerMinute: number; longestRecording: number; recordingsByWeekday: { [key: string]: number }; totalTags: number; assignedTags: number; memosWithoutTags: number; averageTagsPerMemo: number; mostUsedTags: { name: string; count: number; color: string }[]; topLocations: { city: string; count: number }[]; } const InsightsCard: React.FC = ({ averageAudioDuration, averageWordsPerMinute, longestRecording, recordingsByWeekday, totalTags, assignedTags, memosWithoutTags, averageTagsPerMemo, mostUsedTags, topLocations, }) => { const { isDark } = useTheme(); const { t } = useTranslation(); const textColor = isDark ? '#FFFFFF' : '#000000'; const sectionTitleColor = isDark ? '#CCCCCC' : '#666666'; return ( Insights {/* Audio Insights */} {t('statistics.section_audio')} {/* Tag Analytics */} {t('statistics.section_tags')} {mostUsedTags.length > 0 && ( <> {t('statistics.most_used_tags') || 'Meistgenutzte Tags'} {mostUsedTags.slice(0, 5).map((tag) => ( ))} )} {/* Location Data */} {topLocations.length > 0 && ( <> {t('statistics.section_locations')} {topLocations.map((location) => ( ))} )} ); }; 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, }, subSectionTitle: { fontSize: 13, fontWeight: '600', marginTop: 8, marginBottom: 8, opacity: 0.8, }, statsContainer: { gap: 6, }, divider: { height: 0, marginVertical: 18, }, tagDivider: { height: 0, marginVertical: 12, }, }); export default InsightsCard;