This commit is contained in:
Michel Roegl-Brunner
2025-03-17 16:16:45 +01:00
parent bdf2eb6188
commit 980ad57b05
4 changed files with 32 additions and 34 deletions

View File

@@ -1,4 +1,4 @@
"use client";
import { Separator } from "@/components/ui/separator";
import { extractDate } from "@/lib/time";
import { Script, AppVersion } from "@/lib/types";
@@ -39,7 +39,7 @@ function ScriptItem({
useEffect(() => {
fetchVersions(item.slug)
fetchVersions()
.then((fetchedVersions) => {
console.log("Fetched Versions: ", fetchedVersions);
if (Array.isArray(fetchedVersions)) {
@@ -51,7 +51,7 @@ useEffect(() => {
}
})
.catch((error) => console.error("Error fetching versions:", error));
}, [item.name]);
}, []);
const defaultInstallMethod = item.install_methods?.[0];
const os = defaultInstallMethod?.resources?.os || "Proxmox Node";
@@ -103,7 +103,9 @@ const version = defaultInstallMethod?.resources?.version || "";
{versions.length === 0 ? (
<p>Loading versions...</p>
) : (
<p>Version: {versions[0].version}</p>
<p>Version: {
versions.find((v) => v.name === item.slug.replace(/[^a-z0-9]/g, ''))?.version || "Not found"
}</p>
)}
</div>