import { useMemo } from 'react' import EpicGameItem from '@/components/games/EpicGameItem' import { EpicGame } from '@/types/EpicGame' import LoadingIndicator from '../common/LoadingIndicator' interface EpicGameListProps { games: EpicGame[] isLoading: boolean installingId: string | null onInstall: (game: EpicGame) => void onUninstallScream: (game: EpicGame) => void onUninstallKoaloader: (game: EpicGame) => void onSettings: (game: EpicGame) => void } const EpicGameList = ({ games, isLoading, installingId, onInstall, onUninstallScream, onUninstallKoaloader, onSettings, }: EpicGameListProps) => { const sortedGames = useMemo( () => [...games].sort((a, b) => a.title.localeCompare(b.title)), [games] ) if (isLoading) { return (
) } return (

Epic Games ({games.length})

{games.length === 0 ? (
No Epic games found. Make sure Heroic is installed and has games downloaded.
) : (
{sortedGames.map((game) => ( ))}
)}
) } export default EpicGameList