MCPcopy Index your code
hub / github.com/nodejs/nodejs.org / DownloadButton

Function DownloadButton

apps/site/components/Downloads/DownloadButton/index.tsx:16–48  ·  view source on GitHub ↗
({
  release: { versionWithPrefix },
  children,
})

Source from the content-addressed store, hash-verified

14type DownloadButtonProps = { release: NodeRelease };
15
16const DownloadButton: FC<PropsWithChildren<DownloadButtonProps>> = ({
17 release: { versionWithPrefix },
18 children,
19}) => {
20 const { os, bitness, architecture } = getClientContext();
21
22 const platform = getUserPlatform(architecture, bitness);
23 const downloadLink = getNodeDownloadUrl({ versionWithPrefix, os, platform });
24
25 return (
26 <>
27 <Button
28 kind="special"
29 href={downloadLink}
30 className={classNames(styles.downloadButton, styles.special)}
31 >
32 {children}
33
34 <CloudArrowDownIcon />
35 </Button>
36
37 <Button
38 kind="primary"
39 href={downloadLink}
40 className={classNames(styles.downloadButton, styles.primary)}
41 >
42 {children}
43
44 <CloudArrowDownIcon />
45 </Button>
46 </>
47 );
48};
49
50export default DownloadButton;

Callers

nothing calls this directly

Calls 2

getUserPlatformFunction · 0.90
getNodeDownloadUrlFunction · 0.90

Tested by

no test coverage detected