diff --git a/packages/kcmsf/src/pages/result.tsx b/packages/kcmsf/src/pages/result.tsx index 845e4b43..000d9156 100644 --- a/packages/kcmsf/src/pages/result.tsx +++ b/packages/kcmsf/src/pages/result.tsx @@ -217,22 +217,32 @@ const PreResultColum = (props: { match: PreMatch }) => { ), [props.match] ); + const leftGoalTimeSeconds = useMemo(() => { + if (!leftResult) { + return ""; + } else { + if (leftResult.goalTimeSeconds) + return parseSeconds(leftResult.goalTimeSeconds); + return "フィニッシュ"; + } + }, [leftResult]); + const rightGoalTimeSeconds = useMemo(() => { + if (!rightResult) { + return ""; + } else { + if (rightResult.goalTimeSeconds) + return parseSeconds(rightResult.goalTimeSeconds); + return "フィニッシュ"; + } + }, [leftResult]); return ( <> {props.match.leftTeam?.teamName} {leftResult?.points} - - {leftResult?.finishState === "goal" - ? (parseSeconds(leftResult.goalTimeSeconds) ?? "") - : "フィニッシュ"} - + {leftGoalTimeSeconds} {props.match.rightTeam?.teamName} {rightResult?.points} - - {rightResult?.finishState === "goal" - ? (parseSeconds(rightResult.goalTimeSeconds) ?? "") - : "フィニッシュ"} - + {rightGoalTimeSeconds} ); };