Skip to content

Commit

Permalink
fix: 型を合わせた
Browse files Browse the repository at this point in the history
  • Loading branch information
speak-mentaiko committed Oct 11, 2024
1 parent d215f82 commit 4123224
Showing 1 changed file with 20 additions and 10 deletions.
30 changes: 20 additions & 10 deletions packages/kcmsf/src/pages/result.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<>
<Table.Td className="td">{props.match.leftTeam?.teamName}</Table.Td>
<Table.Td className="td">{leftResult?.points}</Table.Td>
<Table.Td className="td">
{leftResult?.finishState === "goal"
? (parseSeconds(leftResult.goalTimeSeconds) ?? "")
: "フィニッシュ"}
</Table.Td>
<Table.Td className="td">{leftGoalTimeSeconds}</Table.Td>
<Table.Td className="td">{props.match.rightTeam?.teamName}</Table.Td>
<Table.Td className="td">{rightResult?.points}</Table.Td>
<Table.Td className="td">
{rightResult?.finishState === "goal"
? (parseSeconds(rightResult.goalTimeSeconds) ?? "")
: "フィニッシュ"}
</Table.Td>
<Table.Td className="td">{rightGoalTimeSeconds}</Table.Td>
</>
);
};

0 comments on commit 4123224

Please sign in to comment.