diff --git a/src/app/download/DownloadsSelector.tsx b/src/app/download/DownloadsSelector.tsx index cac4cd6d..61853ea7 100644 --- a/src/app/download/DownloadsSelector.tsx +++ b/src/app/download/DownloadsSelector.tsx @@ -65,115 +65,135 @@ export default function DownloadsSelector() { /> - {downloadsMetadata.repos.map((repo) => ( - // "overflow: unset" is needed, since otherwise "overflow: hidden" - // on the Card breaks the scroll-margin-top of the Title / h2, and - // the title ends up under the sticky header. - - - {repo.name} - - - {repo.description} - - - {repo.fullName} - - - - - - {repo.releases.map((release) => ( - - - - - - - {release.name} - {release.prerelease ? ( - - Pre-release - - ) : release.ltsRelease ? ( - - LTS - - ) : ( - - Latest - - )} - - - Release notes - - - - - - File name - OS - Arch - Size - SHA256 Checksum - - - - {release.binaries - .filter((b) => { - if ( - osList.includes(b.os) && - arch === "popular" && - (b.arch === "amd64" || - (b.os === "darwin" && b.arch === "arm64")) - ) { - return true; - } else if ( - osList.includes(b.os) && - (arch === "all" || b.arch === arch) - ) { - return true; - } else { - return false; - } - }) - .map((binary) => ( - - - - {binary.name} - + {downloadsMetadata.repos.map((repo) => { + let latestAssigned = false; + + return ( + // "overflow: unset" is needed, since otherwise "overflow: hidden" + // on the Card breaks the scroll-margin-top of the Title / h2, and + // the title ends up under the sticky header. + + + {repo.name} + + + {repo.description} + + + {repo.fullName} + + + + +
+ {repo.releases.map((release) => { + const badges: React.ReactNode[] = []; + + if (release.prerelease) { + badges.push( + + Pre-release + + ); + } else { + if (!latestAssigned) { + badges.push( + + Latest + + ); + latestAssigned = true; + } + if (release.ltsRelease) { + badges.push( + + LTS + + ); + } + } + + return ( + + + + + + + {release.name} + {badges} + + + Release notes + + - {binary.os} - {binary.arch} - - {(binary.sizeBytes / 1024 / 1024).toFixed(2)} MiB - - {binary.checksum} - ))} - - - ))} -
-
-
- ))} + + File name + OS + Arch + Size + SHA256 Checksum + + + + {release.binaries + .filter((b) => { + if ( + osList.includes(b.os) && + arch === "popular" && + (b.arch === "amd64" || + (b.os === "darwin" && b.arch === "arm64")) + ) { + return true; + } else if ( + osList.includes(b.os) && + (arch === "all" || b.arch === arch) + ) { + return true; + } else { + return false; + } + }) + .map((binary) => ( + + + + {binary.name} + + + {binary.os} + {binary.arch} + + {(binary.sizeBytes / 1024 / 1024).toFixed(2)} MiB + + {binary.checksum} + + ))} + + + ); + })} + + + + ); + })} ); }