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