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

interface UninstallButtonProps {
  pathExists: boolean | null;
  uninstalling: boolean;
  onUninstallClick: () => void;
}

export function UninstallButton({ pathExists, uninstalling, onUninstallClick }: UninstallButtonProps) {
  if (pathExists !== true) return null;

  return (
    <PanelSectionRow>
      <ButtonItem 
        layout="below" 
        onClick={onUninstallClick} 
        disabled={uninstalling}
      >
        <div style={{ 
          color: '#ef4444',
          fontWeight: 'bold'
        }}>
          {uninstalling ? MESSAGES.uninstalling : MESSAGES.uninstallButton}
        </div>
      </ButtonItem>
    </PanelSectionRow>
  );
}