import { Ionicons } from '@expo/vector-icons'; import { useRouter } from 'expo-router'; import { Pressable, ScrollView, StyleSheet, Text, View } from 'react-native'; import { SafeAreaView } from 'react-native-safe-area-context'; import { useHistory } from '../src/hooks'; import { JobCard } from '../src/components/JobCard'; import { LoadingState, ErrorState, EmptyState } from '../src/components/StateView'; import { colors , spacing } from '../src/theme'; /** * 浏览历史页(职位) */ export default function HistoryScreen() { const router = useRouter(); const { items, loading, error, refresh, isEmpty } = useHistory(); return ( router.back()} hitSlop={8}> 浏览历史 {loading ? ( ) : error ? ( ) : isEmpty ? ( ) : ( {items.map((job) => ( router.push(`/jobs/${job.id}`)} /> ))} )} ); } const styles = StyleSheet.create({ safeArea: { flex: 1, backgroundColor: colors.pageBg, }, header: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', paddingHorizontal: spacing.card, height: 48, backgroundColor: colors.white, borderBottomWidth: 1, borderBottomColor: colors.borderLight, }, headerBtn: { width: 40, height: 40, alignItems: 'center', justifyContent: 'center', }, headerTitle: { fontSize: 17, fontWeight: '700', color: colors.textPrimary, }, scroll: { flex: 1, }, content: { paddingHorizontal: spacing.card, paddingTop: 12, paddingBottom: 24, }, });