import { DialogBody, DialogButton, DialogControlsSection, Focusable, Navigation } from 'decky-frontend-lib'; import { useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { FaDownload, FaInfo } from 'react-icons/fa'; import { setSetting } from '../../../../utils/settings'; import { UpdateBranch } from '../general/BranchSelect'; interface TestingVersion { id: number; name: string; link: string; head_sha: string; } const getTestingVersions = DeckyBackend.callable<[], TestingVersion[]>('updater/get_testing_versions'); const downloadTestingVersion = DeckyBackend.callable<[pr_id: number, sha: string]>('updater/download_testing_version'); export default function TestingVersionList() { const { t } = useTranslation(); const [testingVersions, setTestingVersions] = useState([]); useEffect(() => { (async () => { setTestingVersions(await getTestingVersions()); })(); }, []); if (testingVersions.length === 0) { return (

No open PRs found

); } return (
    {testingVersions.map((version) => { return (
  • {version.name} {'#' + version.id} { downloadTestingVersion(version.id, version.head_sha); setSetting('branch', UpdateBranch.Testing); }} >
    {t('Testing.download')}
    Navigation.NavigateToExternalWeb(version.link)} >
  • ); })}
); }