more optimizations

This commit is contained in:
yohlo
2025-08-27 11:04:04 -05:00
parent e5f3bbe095
commit b7de2e7af3
7 changed files with 49 additions and 23 deletions

View File

@@ -1,5 +1,5 @@
import { Flex } from '@mantine/core';
import React from 'react';
import React, { useCallback } from 'react';
import { BracketMaps } from '../utils/bracket-maps';
import { BracketRound } from './bracket-round';
import { Match } from '../types';
@@ -16,7 +16,7 @@ const BracketView: React.FC<BracketViewProps> = ({
onAnnounce,
}) => {
const getParentMatchOrder = (parentLid: number): number | string => {
const getParentMatchOrder = useCallback((parentLid: number): number | string => {
const parentMatch = bracketMaps.matchByLid.get(parentLid);
if (
parentMatch &&
@@ -26,7 +26,7 @@ const BracketView: React.FC<BracketViewProps> = ({
return parentMatch.order;
}
return `Match ${parentLid}`;
};
}, [bracketMaps]);
return (
<Flex direction="row" gap={24} justify="left" pos="relative" p="xl">