import { ButtonItem, Field, PanelSectionRow } from "@decky/ui"; import { GameTarget } from "../hooks/useGameConfiguration"; interface Props { targets: GameTarget[]; runningGame: GameTarget | null; onSelect: (appid: string) => void; onResetAll: () => Promise; } const profileDescription = (target: GameTarget, running: boolean, active: boolean) => [ running ? "Now playing" : "", target.nonSteam ? "Non-Steam" : "Steam", target.configured ? active ? "Profile active" : "Profile saved · applies next launch" : "Not configured · changes apply next launch", ].filter(Boolean).join(" · "); export function GameConfigurationSelector({ targets, runningGame, onSelect, onResetAll }: Props) { const games = [...targets].sort((a, b) => { if (a.appid === runningGame?.appid) return -1; if (b.appid === runningGame?.appid) return 1; return a.name.localeCompare(b.name); }); return ( <> {games.length === 0 && ( )} {games.map((game) => ( onSelect(game.appid)} highlightOnFocus /> ))} void onResetAll()} disabled={!targets.some((target) => target.configured)} > Remove all profiles ); }