summaryrefslogtreecommitdiff
path: root/src/components/InstallationStatus.tsx
blob: 713b5e17730b509d9bf5adb183893245659c2ac8 (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
import { PanelSectionRow, ButtonItem } from "@decky/ui";
import { MESSAGES, STYLES } from "../utils/constants";

interface InstallationStatusProps {
  pathExists: boolean | null;
  installing: boolean;
  onInstallClick: () => void;
}

export function InstallationStatus({ pathExists, installing, onInstallClick }: InstallationStatusProps) {
  if (pathExists !== false) return null;

  return (
    <>
      <PanelSectionRow>
        <div style={STYLES.statusNotInstalled}>
          {MESSAGES.modNotInstalled}
        </div>
      </PanelSectionRow>
      
      <PanelSectionRow>
        <ButtonItem layout="below" onClick={onInstallClick} disabled={installing}>
          {installing ? MESSAGES.installing : MESSAGES.installButton}
        </ButtonItem>
      </PanelSectionRow>
    </>
  );
}