diff options
Diffstat (limited to 'src/components/UninstallButton.tsx')
| -rw-r--r-- | src/components/UninstallButton.tsx | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/components/UninstallButton.tsx b/src/components/UninstallButton.tsx new file mode 100644 index 0000000..1f55548 --- /dev/null +++ b/src/components/UninstallButton.tsx @@ -0,0 +1,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> + ); +} |
