blob: 69e72d70943ead21ac8ce7383d0e8c1ee6edcf0e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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>
);
}
|