From bce981b1e7dad5da84197eb4357658eb5fdd5ad0 Mon Sep 17 00:00:00 2001
From: xXJSONDeruloXx <danielhimebauch@gmail.com>
Date: Wed, 22 Jan 2025 23:20:00 -0500
Subject: cleaned up install output debugging, added instructions

---
 src/index.tsx | 71 +++++++++++++++++++++++++++++++----------------------------
 1 file changed, 37 insertions(+), 34 deletions(-)

(limited to 'src/index.tsx')

diff --git a/src/index.tsx b/src/index.tsx
index afb3cdd..b0c1e15 100755
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,10 +1,13 @@
-import { useState, useEffect } from "react";
+import { 
+  useState, 
+  // useEffect 
+} from "react";
 import {
   PanelSection,
   PanelSectionRow,
   ButtonItem,
-  Dropdown,
-  DropdownOption
+  // Dropdown,
+  // DropdownOption
 } from "@decky/ui";
 import { definePlugin, callable } from "@decky/api";
 import { FaShip } from "react-icons/fa";
@@ -16,7 +19,7 @@ const runInstallFGMod = callable<
 >("run_install_fgmod");
 
 // "get_installed_games" corresponds to the Python method get_installed_games()
-const fetchInstalledGames = callable<[], string>("get_installed_games");
+// const fetchInstalledGames = callable<[], string>("get_installed_games");
 
 function FGModInstallerSection() {
   const [installing, setInstalling] = useState(false);
@@ -64,44 +67,44 @@ function FGModInstallerSection() {
   );
 }
 
-function GameSelectorSection() {
-  const [games, setGames] = useState<DropdownOption[]>([]);
-  const [selectedGame, setSelectedGame] = useState<DropdownOption | null>(null);
+// function GameSelectorSection() {
+//   const [games, setGames] = useState<DropdownOption[]>([]);
+//   const [selectedGame, setSelectedGame] = useState<DropdownOption | null>(null);
 
-  useEffect(() => {
-    const loadGames = async () => {
-      const result = await fetchInstalledGames();
-      const gameList = JSON.parse(result) as { appid: string; name: string }[];
-      setGames(gameList.map((g) => ({ data: g.appid, label: g.name })));
-    };
+//   useEffect(() => {
+//     const loadGames = async () => {
+//       const result = await fetchInstalledGames();
+//       const gameList = JSON.parse(result) as { appid: string; name: string }[];
+//       setGames(gameList.map((g) => ({ data: g.appid, label: g.name })));
+//     };
 
-    loadGames();
-  }, []);
+//     loadGames();
+//   }, []);
 
-  return (
-    <PanelSection title="Installed Games">
-      <PanelSectionRow>
-        <Dropdown
-          rgOptions={games}
-          selectedOption={selectedGame?.data || null}
-          onChange={(option) => setSelectedGame(option)}
-          strDefaultLabel="Select a game"
-        />
-      </PanelSectionRow>
-      {selectedGame && (
-        <PanelSectionRow>
-          <div>You selected: {selectedGame.label}</div>
-        </PanelSectionRow>
-      )}
-    </PanelSection>
-  );
-}
+//   return (
+//     <PanelSection title="Installed Games">
+//       <PanelSectionRow>
+//         <Dropdown
+//           rgOptions={games}
+//           selectedOption={selectedGame?.data || null}
+//           onChange={(option) => setSelectedGame(option)}
+//           strDefaultLabel="Select a game"
+//         />
+//       </PanelSectionRow>
+//       {selectedGame && (
+//         <PanelSectionRow>
+//           <div>You selected: {selectedGame.label}</div>
+//         </PanelSectionRow>
+//       )}
+//     </PanelSection>
+//   );
+// }
 
 function MainContent() {
   return (
     <>
       <FGModInstallerSection />
-      <GameSelectorSection />
+      {/* <GameSelectorSection /> */}
     </>
   );
 }
-- 
cgit v1.2.3

