more bracket work

This commit is contained in:
2025-09-04 11:37:33 -05:00
parent 2f6950ee9e
commit d2e6849bca
25 changed files with 8459 additions and 115 deletions

View File

@@ -0,0 +1,44 @@
import { Flex } from "@mantine/core";
import { Match } from "@/features/matches/types";
import { MatchCard } from "./match-card";
interface BracketProps {
rounds: Match[][];
orders: Record<number, number>;
onAnnounce?: (teamOne: any, teamTwo: any) => void;
}
export const Bracket: React.FC<BracketProps> = ({
rounds,
orders,
onAnnounce,
}) => {
return (
<Flex direction="row" gap={24} justify="left" p="xl">
{rounds.map((round, roundIndex) => (
<Flex
key={roundIndex}
direction="column"
align="center"
pos="relative"
gap={24}
justify="space-around"
>
{round
.filter((match) => !match.bye)
.map((match) => {
return (
<div key={match.lid}>
<MatchCard
match={match}
orders={orders}
onAnnounce={onAnnounce}
/>
</div>
);
})}
</Flex>
))}
</Flex>
);
};