restarting brackets

This commit is contained in:
yohlo
2025-09-03 21:57:47 -05:00
parent 1a21171ae8
commit 2f6950ee9e
20 changed files with 307 additions and 230 deletions

View File

@@ -1,46 +0,0 @@
import { ScrollArea, Text } from "@mantine/core";
import BracketView from "./bracket-view";
import { Match } from "../types";
import useAppShellHeight from "@/hooks/use-appshell-height";
import { BracketMaps } from "../utils/bracket-maps";
interface BracketProps {
winners: Match[][];
losers?: Match[][];
bracketMaps: BracketMaps | null;
}
const Bracket: React.FC<BracketProps> = ({ winners, losers, bracketMaps }) => {
const height = useAppShellHeight();
if (!bracketMaps) return <p>Bracket not available.</p>;
return (
<ScrollArea
h={`calc(${height} - 4rem)`}
className="bracket-container"
style={{
backgroundImage: `radial-gradient(circle, var(--mantine-color-default-border) 1px, transparent 1px)`,
backgroundSize: "16px 16px",
backgroundPosition: "0 0, 8px 8px",
}}
>
<div>
<Text fw={600} size="md" m={16}>
Winners Bracket
</Text>
<BracketView bracket={winners} bracketMaps={bracketMaps} />
</div>
{losers && (
<div>
<Text fw={600} size="md" m={16}>
Losers Bracket
</Text>
<BracketView bracket={losers} bracketMaps={bracketMaps} />
</div>
)}
</ScrollArea>
);
};
export default Bracket;