mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-26 16:35:39 +00:00
Add fixed bugs tab to versions
This commit is contained in:
23
src/app/components/versions/IssueList.tsx
Normal file
23
src/app/components/versions/IssueList.tsx
Normal 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>
|
||||
}
|
||||
Reference in New Issue
Block a user