better brackets, info types
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import { createFileRoute, redirect } from '@tanstack/react-router'
|
||||
import { createFileRoute, redirect, useRouter } from '@tanstack/react-router'
|
||||
import { tournamentQueries } 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'
|
||||
import { Info } from '@phosphor-icons/react'
|
||||
|
||||
export const Route = createFileRoute('/_authed/admin/tournaments/run/$id')({
|
||||
beforeLoad: async ({ context, params }) => {
|
||||
@@ -25,6 +28,30 @@ export const Route = createFileRoute('/_authed/admin/tournaments/run/$id')({
|
||||
})
|
||||
|
||||
function RouteComponent() {
|
||||
const { id } = Route.useParams()
|
||||
return <p>Run tournament</p>
|
||||
const { tournament } = Route.useRouteContext()
|
||||
const router = useRouter()
|
||||
|
||||
const handleSuccess = () => {
|
||||
router.navigate({
|
||||
to: '/admin/tournaments/$id',
|
||||
params: { id: tournament.id }
|
||||
})
|
||||
}
|
||||
|
||||
console.log('Tournament:', tournament)
|
||||
|
||||
return (
|
||||
<Container size="md">
|
||||
{
|
||||
tournament.matches?.length ?
|
||||
<p>Matches</p>
|
||||
: (
|
||||
<SeedTournament
|
||||
tournamentId={tournament.id}
|
||||
teams={tournament.teams || []}
|
||||
onSuccess={handleSuccess}
|
||||
/>)
|
||||
}
|
||||
</Container>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user