'use client' import { useEffect } from 'react' import './Installs.css' import { useGlobal } from './GlobalProvider' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faCheck, faShieldHalved, faWarning } from '@fortawesome/free-solid-svg-icons' import { platform } from '@tauri-apps/plugin-os' import { useRouter } from 'next/navigation' export default function Installs () { const { showPopup, setShowPopup, setPopupMode, setFadeOut, setSelectedVersionList, downloadedVersionsConfig, normalConfig, setSelectedGame, getListOfGames, getVersionsAmountData, setCategory } = useGlobal() const router = useRouter() useEffect(() => { if (!showPopup) return setSelectedVersionList([]) }, [normalConfig, setSelectedVersionList, showPopup]) return (

Games

{downloadedVersionsConfig && Object.keys(downloadedVersionsConfig.list).length ? ( getListOfGames() .sort((a, b) => { return a.id - b.id }) .map(i => (
{ if (normalConfig?.settings.useLegacyInteractButtons) return setCategory(-1) router.push('/game?id=' + i.id) }} >

{i.name}

e.stopPropagation()} >

{(() => { const data = getVersionsAmountData(i.id) if (!data) return 'N/A' return `${data.installed}/${data.total}` })()}{' '} versions installed

)) ) : (

No games installed

)}
) }