import styles from "@/app/tabStyles/indexStyles"; import ShowCard from "@/components/ui/ShowCard"; import { useShowContext } from "@/contexts/ShowContext"; import { useStreamingServiceContext } from "@/contexts/StreamingServiceContext"; import { router } from "expo-router"; import React from "react"; import { ActivityIndicator, Text, View } from "react-native"; import { GestureHandlerRootView, ScrollView, } from "react-native-gesture-handler"; export default function HomeScreen() { const { shows, error, loading } = useShowContext(); const { streamingServices } = useStreamingServiceContext(); if (loading) { return ( ); } if (error) { return ( Error: {error} ); } return ( FLTR {shows.map((show) => { const showLiveBadge = show.running; const streamingService = streamingServices[ `assets.images.streamingServices.${show.streamingService.toLowerCase()}` ]; return ( router.push({ pathname: "/showDetails", params: { id: String(show.id), title: show.title, bannerUri: show.bannerUri, description: show.description, concept: show.concept, genres: show.genres, streamingService: show.streamingService, }, }) } imageUri={show.bannerUri} streamingServiceUri={streamingService} genres={show.genres} {...(showLiveBadge ? { liveBadgeText: "LIVE", liveBadgeContainerStyle: styles.liveBadgeContainer, } : {})} /> ); })} ); }