diff --git a/src/locales/pt-BR/translation.json b/src/locales/pt-BR/translation.json index 3556dbd1..79b9a4b2 100644 --- a/src/locales/pt-BR/translation.json +++ b/src/locales/pt-BR/translation.json @@ -336,6 +336,8 @@ "quit": "Fechar" }, "game_card": { + "available_one": "Disponível", + "available_other": "Disponíveis", "no_downloads": "Sem downloads disponíveis" }, "binary_not_found_modal": { diff --git a/src/renderer/src/components/game-card/game-card.tsx b/src/renderer/src/components/game-card/game-card.tsx index 12dcda49..9859fe1e 100644 --- a/src/renderer/src/components/game-card/game-card.tsx +++ b/src/renderer/src/components/game-card/game-card.tsx @@ -7,7 +7,7 @@ import "./game-card.scss"; import { useTranslation } from "react-i18next"; import { Badge } from "../badge/badge"; -import { useCallback, useState } from "react"; +import { useCallback, useState, useMemo } from "react"; import { useFormat, useRepacks } from "@renderer/hooks"; import { steamUrlBuilder } from "@shared"; @@ -45,6 +45,15 @@ export function GameCard({ game, ...props }: GameCardProps) { const { numberFormatter } = useFormat(); + const firstThreeRepackers = useMemo( + () => uniqueRepackers.slice(0, 3), + [uniqueRepackers] + ); + const remainingCount = useMemo( + () => uniqueRepackers.length - 3, + [uniqueRepackers] + ); + return (