From ad2b182777bfd0a5ceef6e654df75ff13eb8b503 Mon Sep 17 00:00:00 2001
From: xXJSONDeruloXx <danielhimebauch@gmail.com>
Date: Sun, 6 Sep 2026 15:08:45 -0400
Subject: refactor: offload configuration to lsfg-vk

---
 src/components/GameConfigurationSelector.tsx | 29 ++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 src/components/GameConfigurationSelector.tsx

(limited to 'src/components/GameConfigurationSelector.tsx')

diff --git a/src/components/GameConfigurationSelector.tsx b/src/components/GameConfigurationSelector.tsx
new file mode 100644
index 0000000..8a0df6c
--- /dev/null
+++ b/src/components/GameConfigurationSelector.tsx
@@ -0,0 +1,29 @@
+import { Dropdown, DropdownOption, PanelSectionRow, ButtonItem } from "@decky/ui";
+import { GameTarget } from "../hooks/useGameConfiguration";
+
+interface Props {
+  targets: GameTarget[];
+  runningGame: GameTarget | null;
+  selectedAppId: string;
+  onSelect: (appid: string) => void;
+  onReset: () => Promise<void>;
+  onResetAll: () => Promise<void>;
+}
+
+export function GameConfigurationSelector({ targets, runningGame, selectedAppId, onSelect, onReset, onResetAll }: Props) {
+  const options: DropdownOption[] = [
+    { data: "", label: runningGame ? `Default (editing template) · ${runningGame.name}` : "Default" },
+    ...targets.map((target) => ({ data: target.appid, label: `${target.name} · ${target.appid}` })),
+  ];
+  return <>
+    <PanelSectionRow>
+      <Dropdown rgOptions={options} selectedOption={selectedAppId} onChange={(option) => onSelect(String(option.data))} />
+    </PanelSectionRow>
+    <PanelSectionRow>
+      <ButtonItem layout="below" onClick={() => void onReset()} disabled={!selectedAppId}>Reset selected game</ButtonItem>
+    </PanelSectionRow>
+    <PanelSectionRow>
+      <ButtonItem layout="below" onClick={() => void onResetAll()} disabled={!targets.some((target) => target.configured)}>Reset all game profiles</ButtonItem>
+    </PanelSectionRow>
+  </>;
+}
-- 
cgit v1.2.3

