Skip to content

Commit d8c8706

Browse files
committed
downloads: Make files with English text client components
1 parent e740559 commit d8c8706

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

src/app/downloads/extensions.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use client";
2+
13
import { Group, Stack, Text, Title } from "@mantine/core";
24
import classes from "./extensions.module.css";
35
import React from "react";

src/app/downloads/page.tsx

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
"use client";
2+
3+
import React, { useState, useEffect } from "react";
14
import {
25
Button,
36
Code,
@@ -8,7 +11,6 @@ import {
811
Title,
912
} from "@mantine/core";
1013
import classes from "./downloads.module.css";
11-
import React from "react";
1214
import { ExtensionList } from "@/app/downloads/extensions";
1315
import { NightlyList } from "@/app/downloads/nightlies";
1416
import Link from "next/link";
@@ -93,12 +95,24 @@ function DesktopDownload({ latest }: { latest: GithubRelease | null }) {
9395
);
9496
}
9597

96-
export default async function Page() {
97-
const releases = await getLatestReleases();
98-
const latest = releases.length > 0 ? releases[0] : null;
99-
const nightlies = releases
100-
.filter((release) => release.prerelease)
101-
.slice(0, maxNightlies);
98+
export default function Page() {
99+
const [latest, setLatest] = useState<GithubRelease | null>(null);
100+
const [nightlies, setNightlies] = useState<GithubRelease[]>([]);
101+
useEffect(() => {
102+
const fetchReleases = async () => {
103+
try {
104+
const releases = await getLatestReleases();
105+
const nightlies = releases
106+
.filter((release) => release.prerelease)
107+
.slice(0, maxNightlies);
108+
setNightlies(nightlies);
109+
setLatest(releases.length > 0 ? releases[0] : null);
110+
} catch (err) {
111+
console.warn("Failed to fetch releases", err);
112+
}
113+
};
114+
fetchReleases();
115+
}, []);
102116
return (
103117
<Container size="xl" className={classes.container}>
104118
<Stack gap="xl">

0 commit comments

Comments
 (0)