match status

This commit is contained in:
yohlo
2025-09-11 14:04:05 -05:00
parent 22be6682dd
commit 8dfff139e1
8 changed files with 89 additions and 20 deletions

View File

@@ -17,20 +17,21 @@ import Avatar from "@/components/avatar";
import { useBracketPreview } from "@/features/bracket/queries";
import { BracketData } from "@/features/bracket/types";
import BracketView from "@/features/bracket/components/bracket-view";
import { useQueryClient } from "@tanstack/react-query";
import { tournamentKeys } from "../queries";
interface SeedTournamentProps {
tournamentId: string;
teams: TeamInfo[];
onSuccess?: () => void;
}
const SeedTournament: React.FC<SeedTournamentProps> = ({
tournamentId,
teams,
onSuccess,
teams
}) => {
const [orderedTeams, setOrderedTeams] = useState<TeamInfo[]>(teams);
const { data: bracketPreview } = useBracketPreview(teams.length);
const queryClient = useQueryClient()
const bracket: BracketData = useMemo(
() => ({
@@ -56,7 +57,9 @@ const SeedTournament: React.FC<SeedTournamentProps> = ({
mutationFn: generateTournamentBracket,
successMessage: "Tournament bracket generated successfully!",
onSuccess: () => {
onSuccess?.();
queryClient.invalidateQueries({
queryKey: tournamentKeys.details(tournamentId)
})
},
});