From 8b2e0ad894a77125db2798edd0fb8c8b0c890028 Mon Sep 17 00:00:00 2001 From: Paul Pan Date: Sat, 16 Mar 2024 18:50:03 +0800 Subject: [PATCH] fix: ProblemInfoMenu: display language as human-readable label --- src/components/ProblemInfoMenu.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/ProblemInfoMenu.tsx b/src/components/ProblemInfoMenu.tsx index 01310f3..f9b453c 100644 --- a/src/components/ProblemInfoMenu.tsx +++ b/src/components/ProblemInfoMenu.tsx @@ -19,6 +19,7 @@ import { } from "@chakra-ui/react"; import { Link as ReactRouterLink } from "react-router-dom"; import type { DetailResponse, RuntimeInfo } from "../app/services/problem"; +import { LanguageMap } from "./Languages"; const TitleItem = ({ word }: { word: string }) => (

@@ -76,7 +77,7 @@ export default function ProblemInfoMenu(props: ProblemInfoMenuProps) { {props.data?.context.Languages.map((l) => ( - {l.Lang} + {LanguageMap[l.Lang].label} ))} @@ -122,7 +123,7 @@ export default function ProblemInfoMenu(props: ProblemInfoMenuProps) {