match status
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { createFileRoute, redirect, useRouter } from '@tanstack/react-router'
|
||||
import { tournamentQueries } from '@/features/tournaments/queries'
|
||||
import { tournamentQueries, useTournament } from '@/features/tournaments/queries'
|
||||
import { ensureServerQueryData } from '@/lib/tanstack-query/utils/ensure'
|
||||
import SeedTournament from '@/features/tournaments/components/seed-tournament'
|
||||
import { Container, Alert, Text } from '@mantine/core'
|
||||
@@ -32,8 +32,8 @@ export const Route = createFileRoute('/_authed/admin/tournaments/run/$id')({
|
||||
})
|
||||
|
||||
function RouteComponent() {
|
||||
const { tournament } = Route.useRouteContext()
|
||||
const router = useRouter()
|
||||
const { id } = Route.useParams();
|
||||
const { data: tournament } = useTournament(id)
|
||||
|
||||
const bracket: BracketData = useMemo(() => {
|
||||
if (!tournament.matches || tournament.matches.length === 0) {
|
||||
@@ -67,18 +67,12 @@ function RouteComponent() {
|
||||
return { winners, losers }
|
||||
}, [tournament.matches])
|
||||
|
||||
|
||||
const handleSuccess = () => {
|
||||
router.navigate({
|
||||
to: '/admin/tournaments/$id',
|
||||
params: { id: tournament.id }
|
||||
})
|
||||
}
|
||||
|
||||
const handleStartMatch = (match: Match) => {
|
||||
|
||||
}
|
||||
|
||||
console.log(tournament.matches)
|
||||
|
||||
return (
|
||||
<Container size="md">
|
||||
{
|
||||
@@ -88,7 +82,6 @@ function RouteComponent() {
|
||||
<SeedTournament
|
||||
tournamentId={tournament.id}
|
||||
teams={tournament.teams || []}
|
||||
onSuccess={handleSuccess}
|
||||
/>)
|
||||
}
|
||||
</Container>
|
||||
|
||||
Reference in New Issue
Block a user