import ChallengeCard from '@/components/ChallengeCard' import PenaltyBanner from '@/components/PenalyBanner' import { useChallengeActions } from '@/hooks/useChallengeActions' import { useChallenges } from '@/hooks/useChallenges' import { useGame } from '@/hooks/useGame' import { FontAwesome6 } from '@expo/vector-icons' import { useMemo } from 'react' import { View } from 'react-native' import { Appbar, Banner, FAB, MD3Colors, Surface, Text } from 'react-native-paper' function ChallengeScreenHeader() { return <> } function ChallengeScreenBody() { const game = useGame() const challengeActions = useChallengeActions() const challenges = useChallenges() const currentChallengeAction = useMemo(() => { if (!game.currentChallengeId) return null return challengeActions.challengeActions.find((action) => action.id === game.currentChallengeId) }, [game, challengeActions]) const currentChallenge = useMemo(() => { if (!currentChallengeAction) return null return challenges.challenges.find((challenge) => challenge.id === currentChallengeAction.challengeId) }, [currentChallengeAction, challenges]) return <> {currentChallenge && } {!currentChallenge && game.currentRunner && <> Aucun défi en cours. } } style={{ backgroundColor: MD3Colors.secondary30 }}> Vous êtes poursuiveuse, et n'avez donc pas de défi à accomplir. } export default function ChallengesScreen() { return ( ) }