import React, { useMemo } from "react"; import { Text, ScrollArea } from "@mantine/core"; import { BracketData } from "../types"; import { Bracket } from "./bracket"; import useAppShellHeight from "@/hooks/use-appshell-height"; import { Match } from "@/features/matches/types"; interface BracketViewProps { bracket: BracketData; showControls?: boolean; groupConfig?: { num_groups: number; advance_per_group: number; }; } const BracketView: React.FC = ({ bracket, showControls, groupConfig }) => { const height = useAppShellHeight(); const orders = useMemo(() => { const map: Record = {}; bracket.winners.flat().forEach(match => map[match.lid] = match.order); bracket.losers.flat().forEach(match => map[match.lid] = match.order); return map; }, [bracket.winners, bracket.losers]); return
Winners Bracket
{bracket.losers && (
Losers Bracket
)}
}; export default BracketView;