import { useFocusEffect } from 'expo-router'; import { useCallback, useState } from 'react'; import { FlatList, StyleSheet, Text, View } from 'react-native'; import { TripSummary } from '@/components/TripSummary'; import { getTrips } from '@/lib/storage'; import type { Trip } from '@/lib/types'; export default function TripsScreen() { const [trips, setTrips] = useState(null); useFocusEffect( useCallback(() => { getTrips().then(setTrips); }, []), ); return ( trip.id} renderItem={({ item }) => } ItemSeparatorComponent={() => } ListEmptyComponent={ trips ? ( No trips yet Your completed rides will show up here. ) : null } /> ); } const styles = StyleSheet.create({ list: { backgroundColor: '#fff' }, content: { padding: 16 }, separator: { height: 12 }, empty: { alignItems: 'center', marginTop: 80, gap: 6 }, emptyTitle: { fontSize: 18, fontWeight: '600', color: '#111' }, emptyText: { color: '#666' }, });