summaryrefslogtreecommitdiff
path: root/src/components/NowPlayingTab.tsx
blob: 8d2d779cbc0c415c950e5b792870776d2a6b4c68 (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
import { 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>;
}

export function NowPlayingTab({ game, config, onConfigChange }: Props) {
  return (
    <Focusable>
      <PanelSection>
        <PanelSectionRow>
          <Field
            label={game.name}
            description={`${game.nonSteam ? "Non-Steam" : "Steam"} | App ID ${game.appid}`}
          />
        </PanelSectionRow>
      </PanelSection>
      <GameConfigurationControls config={config} onConfigChange={onConfigChange} />
    </Focusable>
  );
}