summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/index.tsx11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/index.tsx b/src/index.tsx
index 227cce7..98611a2 100755
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -232,6 +232,7 @@ function MainRunningApp() {
function InstalledGamesSection() {
const [games, setGames] = useState<{ appid: string; name: string }[]>([]);
+ const [clickedGame, setClickedGame] = useState<{ appid: string; name: string } | null>(null);
useEffect(() => {
const fetchGames = async () => {
@@ -253,9 +254,17 @@ function InstalledGamesSection() {
<PanelSection title="Installed Games">
{games.map((game) => (
<PanelSectionRow key={game.appid}>
- <ButtonItem layout="below">
+ <ButtonItem
+ layout="below"
+ onClick={() => setClickedGame(game)}
+ >
{game.name} (AppID: {game.appid})
</ButtonItem>
+ {clickedGame?.appid === game.appid && (
+ <div style={{ padding: '8px' }}>
+ You clicked {game.name} with AppID: {game.appid}
+ </div>
+ )}
</PanelSectionRow>
))}
</PanelSection>