Add fixed bugs tab to versions

This commit is contained in:
Misode
2022-11-09 19:08:25 +01:00
parent 46347f1974
commit 6312dfbc71
8 changed files with 84 additions and 7 deletions

View File

@@ -0,0 +1,23 @@
import { useLocale } from '../../contexts/Locale.jsx'
import { useAsync } from '../../hooks/useAsync.js'
import { fetchBugfixes } from '../../services/DataFetcher.js'
import type { VersionId } from '../../services/Schemas.js'
import { Issue } from './Issue.jsx'
interface Props {
version: string
}
export function IssueList({ version }: Props) {
const { locale } = useLocale()
const { value: issues, loading } = useAsync(() => fetchBugfixes(version as VersionId), [version])
return <div class="card-column">
{issues === undefined || loading ? <>
<span class="note">{locale('loading')}</span>
</> : issues.length === 0 ? <>
<span class="note">{locale('versions.fixes.no_results')}</span>
</> : <>
{issues?.map(issue => <Issue key={issue.id} fix={issue} />)}
</>}
</div>
}