From 77494457e2a4f5c80c3a2f7acb054b12d918d8ad Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Sun, 13 Jul 2025 00:04:54 -0400 Subject: restructure for maintainability --- src/components/InstallationButton.tsx | 64 +++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/components/InstallationButton.tsx (limited to 'src/components/InstallationButton.tsx') diff --git a/src/components/InstallationButton.tsx b/src/components/InstallationButton.tsx new file mode 100644 index 0000000..7892678 --- /dev/null +++ b/src/components/InstallationButton.tsx @@ -0,0 +1,64 @@ +import { ButtonItem, PanelSectionRow } from "@decky/ui"; +import { FaDownload, FaTrash } from "react-icons/fa"; + +interface InstallationButtonProps { + isInstalled: boolean; + isInstalling: boolean; + isUninstalling: boolean; + onInstall: () => void; + onUninstall: () => void; +} + +export function InstallationButton({ + isInstalled, + isInstalling, + isUninstalling, + onInstall, + onUninstall +}: InstallationButtonProps) { + const renderButtonContent = () => { + if (isInstalling) { + return ( +
+
Installing...
+
+ ); + } + + if (isUninstalling) { + return ( +
+
Uninstalling...
+
+ ); + } + + if (isInstalled) { + return ( +
+ +
Uninstall lsfg-vk
+
+ ); + } + + return ( +
+ +
Install lsfg-vk
+
+ ); + }; + + return ( + + + {renderButtonContent()} + + + ); +} -- cgit v1.2.3