blob: b4f0557c001e6034a529c17725beef58ee2aa27a (
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
|
import { ButtonItem, Field, Focusable, PanelSection, PanelSectionRow } from "@decky/ui";
import { ConfigurationData } from "../config/configSchema";
import { GameTarget } from "../hooks/useGameConfiguration";
import { GameConfigurationControls } from "./GameConfigurationControls";
interface Props {
game: GameTarget;
config: ConfigurationData;
onConfigChange: (fieldName: keyof ConfigurationData, value: boolean | number | string | string[]) => Promise<void>;
onRemove: () => Promise<void>;
}
export function NowPlayingTab({ game, config, onConfigChange, onRemove }: Props) {
return (
<Focusable>
<PanelSection title="Now Playing">
<PanelSectionRow>
<Field
label={game.name}
description={`${game.nonSteam ? "Non-Steam" : "Steam"} · App ID ${game.appid} · Configured`}
/>
</PanelSectionRow>
</PanelSection>
<GameConfigurationControls config={config} onConfigChange={onConfigChange} />
<PanelSectionRow>
<ButtonItem layout="below" onClick={() => void onRemove()}>
Remove profile
</ButtonItem>
</PanelSectionRow>
</Focusable>
);
}
|