diff --git a/frontend/src/app/scripts/_components/ScriptItem.tsx b/frontend/src/app/scripts/_components/ScriptItem.tsx
index a5f47b826..fd9ae9115 100644
--- a/frontend/src/app/scripts/_components/ScriptItem.tsx
+++ b/frontend/src/app/scripts/_components/ScriptItem.tsx
@@ -1,39 +1,29 @@
-
import { Separator } from "@/components/ui/separator";
-import { extractDate } from "@/lib/time";
-import { Script, AppVersion } from "@/lib/types";
import { fetchVersions } from "@/lib/data";
+import { extractDate } from "@/lib/time";
+import { AppVersion, Script } from "@/lib/types";
import { X } from "lucide-react";
import Image from "next/image";
+import { basePath } from "@/config/siteConfig";
+import { useEffect, useState } from "react";
import { getDisplayValueFromType } from "./ScriptInfoBlocks";
import Alerts from "./ScriptItems/Alerts";
import Buttons from "./ScriptItems/Buttons";
import DefaultPassword from "./ScriptItems/DefaultPassword";
-import DefaultSettings from "./ScriptItems/DefaultSettings";
import Description from "./ScriptItems/Description";
import InstallCommand from "./ScriptItems/InstallCommand";
import InterFaces from "./ScriptItems/InterFaces";
import Tooltips from "./ScriptItems/Tooltips";
-import { basePath } from "@/config/siteConfig";
-import { useEffect, useState } from "react";
-
-function ScriptItem({
- item,
- setSelectedScript,
-}: {
- item: Script;
- setSelectedScript: (script: string | null) => void;
-}) {
+function ScriptItem({ item, setSelectedScript }: { item: Script; setSelectedScript: (script: string | null) => void }) {
const closeScript = () => {
window.history.pushState({}, document.title, window.location.pathname);
setSelectedScript(null);
};
const [versions, setVersions] = useState
Loading versions...
) : - (<> -Version:
-{versions.find((v) => - v.name === item.slug.replace(/[^a-z0-9]/g, '') || - v.name.includes(item.slug.replace(/[^a-z0-9]/g, '')) || - v.name.replace(/[^a-z0-9]/g, '') === item.slug.replace(/[^a-z0-9]/g, '') +
Latest Version changes(Pulled from newreleases.io):
-- {(() => { - const matchedVersion = versions.find((v) => - v.name === item.slug.replace(/[^a-z0-9]/g, '') || - v.name.includes(item.slug.replace(/[^a-z0-9]/g, '')) || - v.name.replace(/[^a-z0-9]/g, '') === item.slug.replace(/[^a-z0-9]/g, '') - ); - return matchedVersion?.date ? - extractDate(matchedVersion.date as unknown as string) : - "No date information found" - })()} -
- >) - } + const IconText = ({ icon, label }: { icon: React.ReactNode; label: string }) => ( + + {icon} + {label} + + ); + + const CPUIcon = ( + + ); + + const RAMIcon = ( + + ); + + const HDDIcon = ( + + ); + + const ResourceDisplay = ({ + title, + cpu, + ram, + hdd, + }: { + title: string; + cpu: number | null; + ram: number | null; + hdd: number | null; + }) => { + const getDisplayValueFromRAM = (ram: number) => + ram >= 1024 ? `${Math.floor(ram / 1024)}GB` : `${ram}MB`; + + const IconText = ({ icon, label }: { icon: React.ReactNode; label: string }) => ( + + {icon} + {label} + + ); + + const hasCPU = typeof cpu === "number" && cpu > 0; + const hasRAM = typeof ram === "number" && ram > 0; + const hasHDD = typeof hdd === "number" && hdd > 0; + + if (!hasCPU && !hasRAM && !hasHDD) return null; + + return ( +Loading versions...
; + } + + const cleanSlug = item.slug.replace(/[^a-z0-9]/gi, "").toLowerCase(); + + const matched = versions.find((v) => { + const cleanName = v.name.replace(/[^a-z0-9]/gi, "").toLowerCase(); + return cleanName === cleanSlug || cleanName.includes(cleanSlug); + }); + + if (!matched) return null; + + return ( +