mirror of
https://github.com/Novattz/creamlinux-installer.git
synced 2026-01-24 12:22:49 -05:00
universal button
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user