@@ -2,7 +2,7 @@ import { motion } from 'framer-motion'
22import React , { useState , useEffect , useContext } from 'react'
33
44import { AuthContext } from 'src/contexts'
5- import { AnalysisWebGame } from 'src/types'
5+ import { MaiaGameEntry } from 'src/types'
66import { streamLichessGames , fetchMaiaGameList } from 'src/api'
77import { getCustomAnalysesAsWebGames } from 'src/lib/customAnalysis'
88import { FavoriteModal } from 'src/components/Common/FavoriteModal'
@@ -44,10 +44,10 @@ export const GameList = ({
4444 'play' | 'hb' | 'custom' | 'lichess' | 'favorites'
4545 > ( showCustom ? 'favorites' : 'play' )
4646 const [ hbSubsection , setHbSubsection ] = useState < 'hand' | 'brain' > ( 'hand' )
47- const [ games , setGames ] = useState < AnalysisWebGame [ ] > ( [ ] )
47+ const [ games , setGames ] = useState < MaiaGameEntry [ ] > ( [ ] )
4848
4949 const [ gamesByPage , setGamesByPage ] = useState < {
50- [ gameType : string ] : { [ page : number ] : AnalysisWebGame [ ] }
50+ [ gameType : string ] : { [ page : number ] : MaiaGameEntry [ ] }
5151 } > ( {
5252 play : { } ,
5353 hand : { } ,
@@ -61,7 +61,7 @@ export const GameList = ({
6161 }
6262 return [ ]
6363 } )
64- const [ favoriteGames , setFavoriteGames ] = useState < AnalysisWebGame [ ] > ( [ ] )
64+ const [ favoriteGames , setFavoriteGames ] = useState < MaiaGameEntry [ ] > ( [ ] )
6565 const [ favoritedGameIds , setFavoritedGameIds ] = useState < Set < string > > (
6666 new Set ( ) ,
6767 )
@@ -72,7 +72,7 @@ export const GameList = ({
7272 // Modal state for favoriting
7373 const [ favoriteModal , setFavoriteModal ] = useState < {
7474 isOpen : boolean
75- game : AnalysisWebGame | null
75+ game : MaiaGameEntry | null
7676 } > ( { isOpen : false , game : null } )
7777
7878 const [ fetchedCache , setFetchedCache ] = useState < {
@@ -127,7 +127,7 @@ export const GameList = ({
127127 streamLichessGames ( targetUser , ( data ) => {
128128 const result = data . pgn . match ( / \[ R e s u l t \s + " ( .+ ?) " \] / ) [ 1 ] || '?'
129129
130- const game : AnalysisWebGame = {
130+ const game : MaiaGameEntry = {
131131 id : data . id ,
132132 label : `${ data . players . white . user ?. id || 'Unknown' } vs. ${ data . players . black . user ?. id || 'Unknown' } ` ,
133133 result : result ,
@@ -155,7 +155,7 @@ export const GameList = ({
155155
156156 fetchMaiaGameList ( gameType , currentPage , lichessId )
157157 . then ( ( data ) => {
158- let parsedGames : AnalysisWebGame [ ] = [ ]
158+ let parsedGames : MaiaGameEntry [ ] = [ ]
159159
160160 if ( gameType === 'favorites' ) {
161161 // Handle favorites response format
@@ -309,7 +309,7 @@ export const GameList = ({
309309 setSelected ( newTab )
310310 }
311311
312- const handleFavoriteGame = ( game : AnalysisWebGame ) => {
312+ const handleFavoriteGame = ( game : MaiaGameEntry ) => {
313313 setFavoriteModal ( { isOpen : true , game } )
314314 }
315315
@@ -377,7 +377,7 @@ export const GameList = ({
377377 }
378378 }
379379
380- const handleDirectUnfavorite = async ( game : AnalysisWebGame ) => {
380+ const handleDirectUnfavorite = async ( game : MaiaGameEntry ) => {
381381 await removeFavoriteGame ( game . id , game . type )
382382 const updatedFavorites = await getFavoritesAsWebGames ( )
383383 setFavoriteGames ( updatedFavorites )
0 commit comments