@@ -17,16 +17,20 @@ import { useTranslation } from 'react-i18next';
1717import { MdOutlineAutoFixHigh } from 'react-icons/md' ;
1818import { SWRResponse } from 'swr' ;
1919
20- import { BracketDisplaySettings } from '../../interfaces/brackets' ;
21- import { Round } from '../../interfaces/round' ;
22- import { StageItemWithRounds } from '../../interfaces/stage_item' ;
23- import { TournamentMinimal } from '../../interfaces/tournament' ;
24- import { Tournament } from '../../openapi' ;
25- import { createRound } from '../../services/round' ;
26- import ActivateNextRoundModal from '../modals/activate_next_round_modal' ;
27- import { NoContent } from '../no_content/empty_table_info' ;
28- import { Translator } from '../utils/types' ;
29- import { responseIsValid } from '../utils/util' ;
20+ import ActivateNextRoundModal from '@components/modals/activate_next_round_modal' ;
21+ import { NoContent } from '@components/no_content/empty_table_info' ;
22+ import { BracketDisplaySettings } from '@components/utils/brackets' ;
23+ import { TournamentMinimal } from '@components/utils/tournament' ;
24+ import { Translator } from '@components/utils/types' ;
25+ import { responseIsValid } from '@components/utils/util' ;
26+ import {
27+ RoundWithMatches ,
28+ StageItemWithRounds ,
29+ StagesWithStageItemsResponse ,
30+ Tournament ,
31+ UpcomingMatchesResponse ,
32+ } from '@openapi' ;
33+ import { createRound } from '@services/round' ;
3034import RoundComponent from './round' ;
3135
3236function AddRoundButton ( {
@@ -40,8 +44,8 @@ function AddRoundButton({
4044 t : Translator ;
4145 tournamentData : TournamentMinimal ;
4246 stageItem : StageItemWithRounds ;
43- swrStagesResponse : SWRResponse ;
44- swrUpcomingMatchesResponse : SWRResponse ;
47+ swrStagesResponse : SWRResponse < StagesWithStageItemsResponse > ;
48+ swrUpcomingMatchesResponse : SWRResponse < UpcomingMatchesResponse > ;
4549 size : 'md' | 'lg' ;
4650} ) {
4751 return (
@@ -71,8 +75,8 @@ export function RoundsGridCols({
7175} : {
7276 stageItem : StageItemWithRounds ;
7377 tournamentData : Tournament ;
74- swrStagesResponse : SWRResponse ;
75- swrUpcomingMatchesResponse : SWRResponse ;
78+ swrStagesResponse : SWRResponse < StagesWithStageItemsResponse > ;
79+ swrUpcomingMatchesResponse : SWRResponse < UpcomingMatchesResponse > ;
7680 readOnly : boolean ;
7781 displaySettings : BracketDisplaySettings ;
7882} ) {
@@ -87,8 +91,11 @@ export function RoundsGridCols({
8791
8892 let result : React . JSX . Element [ ] | React . JSX . Element = stageItem . rounds
8993 . sort ( ( r1 : any , r2 : any ) => ( r1 . name > r2 . name ? 1 : - 1 ) )
90- . filter ( ( round : Round ) => round . matches . length > 0 || displaySettings . matchVisibility === 'all' )
91- . map ( ( round : Round ) => (
94+ . filter (
95+ ( round : RoundWithMatches ) =>
96+ round . matches . length > 0 || displaySettings . matchVisibility === 'all'
97+ )
98+ . map ( ( round : RoundWithMatches ) => (
9299 < RoundComponent
93100 key = { round . id }
94101 tournamentData = { tournamentData }
0 commit comments