@@ -35,7 +35,6 @@ import {
3535 type PersistedGameWsEvent ,
3636 storeManualMove ,
3737 type PersistedMoveMode ,
38- type PersistedReplay ,
3938} from "@/features/match/persistence" ;
4039import { createHumanInvitation , fetchInvitationGame } from "@/features/matches/api" ;
4140import {
@@ -311,7 +310,6 @@ export function MatchPage(): JSX.Element {
311310 const [ persistError , setPersistError ] = useState < string | null > ( null ) ;
312311 const [ retryingPersist , setRetryingPersist ] = useState ( false ) ;
313312 const [ pendingPersistCount , setPendingPersistCount ] = useState ( 0 ) ;
314- const [ replay , setReplay ] = useState < PersistedReplay | null > ( null ) ;
315313 const [ matchMode , setMatchMode ] = useState < MatchMode > ( "play" ) ;
316314 const [ opponentProfile , setOpponentProfile ] = useState < OpponentProfile > ( "model" ) ;
317315 const [ heuristicLevel , setHeuristicLevel ] = useState < HeuristicLevel > ( "normal" ) ;
@@ -1263,7 +1261,6 @@ export function MatchPage(): JSX.Element {
12631261 setPersistError ( null ) ;
12641262 setRetryingPersist ( false ) ;
12651263 clearPendingQueue ( null ) ;
1266- setReplay ( null ) ;
12671264 setPreviewMove ( null ) ;
12681265 setPreviewUntil ( 0 ) ;
12691266 setInfectionMask ( { } ) ;
@@ -1648,7 +1645,6 @@ export function MatchPage(): JSX.Element {
16481645 setPersistError ( null ) ;
16491646 setRetryingPersist ( false ) ;
16501647 clearPendingQueue ( null ) ;
1651- setReplay ( null ) ;
16521648 setPreviewMove ( null ) ;
16531649 setPreviewUntil ( 0 ) ;
16541650 setInfectionMask ( { } ) ;
@@ -1980,7 +1976,6 @@ export function MatchPage(): JSX.Element {
19801976 setThinking ( true ) ;
19811977 try {
19821978 const payload = await fetchPersistedReplay ( accessToken , persistedGameId ) ;
1983- setReplay ( payload ) ;
19841979 setPersistStatus ( `Replay sincronizado. Jugadas: ${ payload . moves . length } ` ) ;
19851980 setPersistError ( null ) ;
19861981 emitFlash ( "Replay sincronizada." , "success" ) ;
@@ -3152,18 +3147,18 @@ export function MatchPage(): JSX.Element {
31523147
31533148 < motion . div className = "space-y-2" variants = { panelSectionVariants } custom = { 0.18 } >
31543149 < div className = "rounded-md border border-zinc-700 bg-zinc-950 p-2 hover:border-zinc-500" >
3155- < p className = "text-[11px] uppercase tracking-[0.12em] text-zinc-500" > Estado de sesion </ p >
3150+ < p className = "text-[11px] uppercase tracking-[0.12em] text-zinc-500" > Estado</ p >
31563151 < p className = "mt-1 text-xs text-zinc-300" >
31573152 { thinking ? `IA activa (${ sideController ( board . current_player ) } ) pensando...` : status }
31583153 </ p >
31593154 </ div >
31603155 < div className = "rounded-md border border-zinc-700 bg-zinc-950 p-2 hover:border-zinc-500" >
3161- < p className = "text-[11px] uppercase tracking-[0.12em] text-zinc-500" > Guardado </ p >
3156+ < p className = "text-[11px] uppercase tracking-[0.12em] text-zinc-500" > Sincronizacion </ p >
31623157 < p className = "mt-1 text-[11px] text-zinc-300" >
31633158 { isSpectate ? (
3164- "Modo espectador : sin historial remoto."
3159+ "Espectador : sin historial remoto."
31653160 ) : isAuthenticated ? (
3166- "Guardado automatico activo al iniciar partida ."
3161+ "Sincronizacion remota habilitada ."
31673162 ) : (
31683163 < >
31693164 Modo local activo.{ " " }
@@ -3174,12 +3169,16 @@ export function MatchPage(): JSX.Element {
31743169 </ >
31753170 ) }
31763171 </ p >
3177- { persistedGameId !== null && (
3178- < p className = "mt-2 break-all text-[11px] text-zinc-400" >
3179- ID partida: < span className = "text-zinc-100" > { persistedGameId } </ span >
3180- </ p >
3181- ) }
3182- < p className = "mt-1 text-[11px] text-zinc-500" > { persistStatus } </ p >
3172+ < p className = "mt-1 truncate text-[11px] text-zinc-500" title = { persistStatus } >
3173+ { persistStatus }
3174+ </ p >
3175+ < div className = "mt-2 h-8" >
3176+ { persistedGameId !== null ? (
3177+ < Button asChild type = "button" size = "sm" variant = "secondary" className = "h-8 w-full" >
3178+ < Link to = { `/profile/games/${ persistedGameId } ` } > Ver replay</ Link >
3179+ </ Button >
3180+ ) : null }
3181+ </ div >
31833182 </ div >
31843183 </ motion . div >
31853184 { persistError !== null && (
@@ -3206,24 +3205,6 @@ export function MatchPage(): JSX.Element {
32063205 ) }
32073206 </ div >
32083207 ) }
3209- { replay !== null && (
3210- < div className = "rounded-md border border-zinc-700 bg-zinc-950 p-2 text-[11px] text-zinc-300" >
3211- < p >
3212- Estado replay: < span className = "text-zinc-100" > { replay . game . status } </ span >
3213- </ p >
3214- < p >
3215- Ganador: < span className = "text-zinc-100" > { replay . game . winner_side ?? "-" } </ span >
3216- </ p >
3217- < p >
3218- Total jugadas: < span className = "text-zinc-100" > { replay . moves . length } </ span >
3219- </ p >
3220- { persistedGameId !== null && (
3221- < Button asChild type = "button" size = "sm" variant = "secondary" className = "mt-2 w-full" >
3222- < Link to = { `/profile/games/${ persistedGameId } ` } > Ver replay detallado</ Link >
3223- </ Button >
3224- ) }
3225- </ div >
3226- ) }
32273208 </ motion . div >
32283209 </ CardContent >
32293210 </ Card >
0 commit comments