({
children: Component,
})
| 20 | * fetches release data, and provides download artifacts to child component |
| 21 | */ |
| 22 | const WithDownloadArchive: FC<WithDownloadArchiveProps> = async ({ |
| 23 | children: Component, |
| 24 | }) => { |
| 25 | const { pathname } = getClientContext(); |
| 26 | |
| 27 | // Extract version from pathname |
| 28 | const version = extractVersionFromPath(pathname); |
| 29 | |
| 30 | // Find the release data for the given version |
| 31 | const releaseData = await provideReleaseData(); |
| 32 | const release = releaseData.find(release => |
| 33 | // Match major version only (e.g., v22.x.x for release.major v22) |
| 34 | version.startsWith(`v${release.major}`) |
| 35 | )!; |
| 36 | |
| 37 | if (!release) { |
| 38 | return notFound(); |
| 39 | } |
| 40 | |
| 41 | const releaseArtifacts = buildReleaseArtifacts(release, version); |
| 42 | |
| 43 | return <Component {...releaseArtifacts} />; |
| 44 | }; |
| 45 | |
| 46 | export default WithDownloadArchive; |
nothing calls this directly
no test coverage detected