universal button

This commit is contained in:
Novattz
2026-01-17 17:54:04 +01:00
parent 58217d61d1
commit bec190691b

View File

@@ -3,7 +3,7 @@ import Button, { ButtonVariant } from '../buttons/Button'
import { Icon, trash, download } from '@/components/icons'
// Define available action types
export type ActionType = 'install_cream' | 'uninstall_cream' | 'install_smoke' | 'uninstall_smoke'
export type ActionType = 'install_cream' | 'uninstall_cream' | 'install_smoke' | 'uninstall_smoke' | 'install_unlocker'
interface ActionButtonProps {
action: ActionType
@@ -18,7 +18,6 @@ interface ActionButtonProps {
* Specialized button for game installation actions
*/
const ActionButton: FC<ActionButtonProps> = ({
action,
isInstalled,
isWorking,
onClick,
@@ -29,10 +28,7 @@ const ActionButton: FC<ActionButtonProps> = ({
const getButtonText = () => {
if (isWorking) return 'Working...'
const isCream = action.includes('cream')
const product = isCream ? 'CreamLinux' : 'SmokeAPI'
return isInstalled ? `Uninstall ${product}` : `Install ${product}`
return isInstalled ? 'Uninstall' : 'Install'
}
// Map to button variant