import { useFocusEffect } from '@react-navigation/native'; import React from 'react'; import { Pressable, SafeAreaView, ScrollView, StyleSheet, Text, View } from 'react-native'; import { useApp } from '@/src/app-context'; export default function ActivityScreen() { const { state, actions } = useApp(); useFocusEffect( React.useCallback(() => { actions.setPage('activity'); return undefined; }, [actions]), ); return ( Activity History Clear Read {state.motionNotifications.length === 0 ? ( All quiet. No notifications yet. ) : ( state.motionNotifications.map((notification) => ( void actions.openMotionNotificationTarget(notification.id, notification.cameraDeviceId) }> {notification.message} {new Date(notification.createdAt).toLocaleString()} )) )} ); } const styles = StyleSheet.create({ safe: { flex: 1, backgroundColor: '#0a0a0c', }, header: { paddingHorizontal: 14, paddingTop: 8, paddingBottom: 10, flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', }, title: { color: '#f9fafb', fontSize: 22, fontWeight: '700', }, clearButton: { borderRadius: 10, borderWidth: 1, borderColor: 'rgba(255,255,255,0.16)', paddingHorizontal: 10, height: 34, alignItems: 'center', justifyContent: 'center', }, clearButtonText: { color: '#d1d5db', fontSize: 12, fontWeight: '600', }, content: { padding: 14, gap: 10, }, emptyState: { borderRadius: 16, borderWidth: 1, borderStyle: 'dashed', borderColor: 'rgba(255,255,255,0.2)', backgroundColor: '#111218', padding: 26, alignItems: 'center', }, emptyText: { color: '#6b7280', fontSize: 13, }, item: { borderRadius: 12, borderWidth: 1, padding: 12, gap: 6, }, unreadItem: { backgroundColor: '#14213d', borderColor: '#1d4ed8', }, readItem: { backgroundColor: '#111218', borderColor: 'rgba(255,255,255,0.08)', }, itemMessage: { color: '#e5e7eb', fontSize: 12, fontWeight: '500', }, itemDate: { color: '#6b7280', fontSize: 11, }, });