diff options
Diffstat (limited to 'src/components/NowPlayingTab.tsx')
| -rw-r--r-- | src/components/NowPlayingTab.tsx | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/components/NowPlayingTab.tsx b/src/components/NowPlayingTab.tsx new file mode 100644 index 0000000..69e72d7 --- /dev/null +++ b/src/components/NowPlayingTab.tsx @@ -0,0 +1,39 @@ +import { Focusable } from "@decky/ui"; +import { ConfigurationData } from "../config/configSchema"; +import type { GameTarget } from "../utils/gameTargets"; +import { sourceLabel } from "../utils/gameTargets"; +import { GameConfigurationControls } from "./GameConfigurationControls"; +import { NowPlayingSummary } from "./NowPlayingSummary"; + +interface Props { + game: GameTarget; + config: ConfigurationData; + onConfigChange: ( + fieldName: keyof ConfigurationData, + value: boolean | number | string | string[], + ) => Promise<void>; +} + +function targetDescription(game: GameTarget): string { + return sourceLabel(game.source); +} + +export function NowPlayingTab({ + game, + config, + onConfigChange, +}: Props) { + return ( + <Focusable> + <NowPlayingSummary + title={game.name} + details={[targetDescription(game), `Controls: ${game.name} profile`]} + /> + <GameConfigurationControls + config={config} + onConfigChange={onConfigChange} + showWorkarounds={false} + /> + </Focusable> + ); +} |
