diff --git a/src/app/components/GuessesList.tsx b/src/app/components/GuessesList.tsx index 4191e0c..deb46b9 100644 --- a/src/app/components/GuessesList.tsx +++ b/src/app/components/GuessesList.tsx @@ -1,3 +1,5 @@ +import { useLanguage } from "@/LanguageContext"; +import { translations } from "@/translations"; import type { Match } from "@/types"; import React from "react"; @@ -5,22 +7,34 @@ interface GuessesListProps { matches: Match[]; } -const GuessesList: React.FC = ({ matches }) => ( - -); +const GuessesList: React.FC = ({ matches }) => { + const { language } = useLanguage(); + const t = translations[language]; + + const getDescription = (match: Match) => { + if (match.translationKey) { + return t[match.translationKey as keyof typeof t]; + } + return match.description; + }; + + return ( + + ); +}; export default GuessesList; diff --git a/src/app/types.ts b/src/app/types.ts index 94e80bc..31fcf13 100644 --- a/src/app/types.ts +++ b/src/app/types.ts @@ -2,6 +2,7 @@ export interface Match { input: string; name: string | undefined; description: string | undefined; + translationKey?: string; correct: boolean; }