import { useT } from '../../lib/use-t'; import { ErrorBoundary } from '@sentry/react'; import { CompetitionsHeader } from '../../components/competitions/competitions-header'; import { Intent, Loader, TradingButton } from '@vegaprotocol/ui-toolkit'; import { useGames } from '../../lib/hooks/use-games'; import { useCurrentEpochInfoQuery } from '../referrals/hooks/__generated__/Epoch'; import { Link, useNavigate } from 'react-router-dom'; import { Links } from '../../lib/links'; import { CompetitionsAction, CompetitionsActionsContainer, } from '../../components/competitions/competitions-cta'; import { GamesContainer } from '../../components/competitions/games-container'; import { CompetitionsLeaderboard } from '../../components/competitions/competitions-leaderboard'; import { useTeams } from '../../lib/hooks/use-teams'; import take from 'lodash/take'; import { usePageTitle } from '../../lib/hooks/use-page-title'; export const CompetitionsHome = () => { const t = useT(); const navigate = useNavigate(); usePageTitle(t('Competitions')); const { data: epochData } = useCurrentEpochInfoQuery(); const currentEpoch = Number(epochData?.epoch.id); const { data: gamesData, loading: gamesLoading } = useGames({ onlyActive: true, currentEpoch, }); const { data: teamsData, loading: teamsLoading } = useTeams({ sortByField: ['totalQuantumRewards'], order: 'desc', }); return (

{t( 'Be a team player! Participate in games and work together to rake in as much profit to win.' )}

{/** Get started */}

{t('Get started')}

{ e.preventDefault(); navigate(Links.COMPETITIONS_CREATE_TEAM()); }} > {t('Create a public team')} } /> { e.preventDefault(); navigate(Links.COMPETITIONS_CREATE_TEAM_SOLO()); }} > {t('Create a private team')} } /> { e.preventDefault(); navigate(Links.COMPETITIONS_TEAMS()); }} > {t('Choose a team')} } /> {/** List of available games */}

{t('Games')}

{gamesLoading ? ( ) : ( )} {/** The teams ranking */}

{t('Leaderboard')}

{t('View all teams')}
{teamsLoading ? ( ) : ( )}
); };