From 85520f891685c4f5b51c59689ad43db7a62d1443 Mon Sep 17 00:00:00 2001 From: Novattz Date: Tue, 23 Dec 2025 01:59:53 +0100 Subject: [PATCH] add settings button to game cards with smokeapi installed #67 --- src/components/games/GameItem.tsx | 24 +++++++++++++++++++++++- src/components/games/GameList.tsx | 5 +++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/components/games/GameItem.tsx b/src/components/games/GameItem.tsx index de0475b..0cbd647 100644 --- a/src/components/games/GameItem.tsx +++ b/src/components/games/GameItem.tsx @@ -8,13 +8,14 @@ interface GameItemProps { game: Game onAction: (gameId: string, action: ActionType) => Promise onEdit?: (gameId: string) => void + onSmokeAPISettings?: (gameId: string) => void } /** * Individual game card component * Displays game information and action buttons */ -const GameItem = ({ game, onAction, onEdit }: GameItemProps) => { +const GameItem = ({ game, onAction, onEdit, onSmokeAPISettings }: GameItemProps) => { const [imageUrl, setImageUrl] = useState(null) const [isLoading, setIsLoading] = useState(true) const [hasError, setHasError] = useState(false) @@ -77,6 +78,13 @@ const GameItem = ({ game, onAction, onEdit }: GameItemProps) => { } } + // SmokeAPI settings handler + const handleSmokeAPISettings = () => { + if (onSmokeAPISettings && game.smoke_installed) { + onSmokeAPISettings(game.id) + } + } + // Determine background image const backgroundImage = !isLoading && imageUrl @@ -156,6 +164,20 @@ const GameItem = ({ game, onAction, onEdit }: GameItemProps) => { iconOnly /> )} + + {/* Edit button - only enabled if SmokeAPI is installed */} + {game.smoke_installed && ( +