import React, { useEffect } from "react"; import { View, FlatList, StyleSheet, ActivityIndicator } from "react-native"; import { ThemedView } from "@/components/ThemedView"; import { ThemedText } from "@/components/ThemedText"; import useFavoritesStore from "@/stores/favoritesStore"; import { Favorite } from "@/services/storage"; import VideoCard from "@/components/VideoCard.tv"; import { api } from "@/services/api"; export default function FavoritesScreen() { const { favorites, loading, error, fetchFavorites } = useFavoritesStore(); useEffect(() => { fetchFavorites(); }, [fetchFavorites]); if (loading) { return ( ); } if (error) { return ( {error} ); } if (favorites.length === 0) { return ( 暂无收藏 ); } const renderItem = ({ item }: { item: Favorite & { key: string } }) => { const [source, id] = item.key.split("+"); return ( ); }; return ( 我的收藏 item.key} numColumns={5} contentContainerStyle={styles.list} /> ); } const styles = StyleSheet.create({ container: { flex: 1, paddingTop: 40, }, headerContainer: { flexDirection: "row", justifyContent: "space-between", alignItems: "center", paddingHorizontal: 24, marginBottom: 10, }, headerTitle: { fontSize: 32, fontWeight: "bold", paddingTop: 16, }, centered: { flex: 1, justifyContent: "center", alignItems: "center", }, list: { padding: 10, }, });