diff --git a/src/renderer/src/pages/game-details/hero/hero-panel-actions.tsx b/src/renderer/src/pages/game-details/hero/hero-panel-actions.tsx index 795aa8af..323b3c8f 100644 --- a/src/renderer/src/pages/game-details/hero/hero-panel-actions.tsx +++ b/src/renderer/src/pages/game-details/hero/hero-panel-actions.tsx @@ -6,6 +6,7 @@ import { useTranslation } from "react-i18next"; import * as styles from "./hero-panel-actions.css"; import { gameDetailsContext } from "@renderer/context"; +import { DownloadIcon } from "@renderer/components/sidebar/download-icon"; export function HeroPanelActions() { const [toggleLibraryGameDisabled, setToggleLibraryGameDisabled] = @@ -25,6 +26,11 @@ export function HeroPanelActions() { selectGameExecutable, } = useContext(gameDetailsContext); + const { lastPacket } = useDownload(); + + const isGameDownloading = + game?.status === "active" && lastPacket?.game.id === game?.id; + const { updateLibrary } = useLibrary(); const { t } = useTranslation("game_details"); @@ -84,6 +90,47 @@ export function HeroPanelActions() { ); + const gameActionButton = () => { + if (isGameRunning) { + return ( + + ); + } + + if (game?.executablePath) { + return ( + + ); + } + + return ( + + ); + }; + if (repacks.length && !game) { return ( <> @@ -96,26 +143,7 @@ export function HeroPanelActions() { if (game) { return (