diff --git a/deno.json b/deno.json index 504974d..ffb64d9 100644 --- a/deno.json +++ b/deno.json @@ -22,6 +22,7 @@ "@std/path": "jsr:@std/path@^1.0.6", "autoprefixer": "npm:autoprefixer@^10.4.20", "babel-plugin-transform-hook-names": "npm:babel-plugin-transform-hook-names@^1.0.2", + "jotai": "npm:jotai@^2.10.1", "less": "npm:less@^4.2.0", "postcss": "npm:postcss@^8.4.47", "preact": "npm:preact@^10.24.3", diff --git a/deno.lock b/deno.lock index 2104d42..7fc0c07 100644 --- a/deno.lock +++ b/deno.lock @@ -18,6 +18,7 @@ "npm:@types/node@*": "22.5.4", "npm:autoprefixer@^10.4.20": "10.4.20_postcss@8.4.47", "npm:babel-plugin-transform-hook-names@^1.0.2": "1.0.2_@babel+core@7.25.8", + "npm:jotai@^2.10.1": "2.10.1", "npm:less@^4.2.0": "4.2.0", "npm:postcss@^8.4.47": "8.4.47", "npm:preact@^10.24.3": "10.24.3", @@ -883,6 +884,9 @@ "jiti@1.21.6": { "integrity": "sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==" }, + "jotai@2.10.1": { + "integrity": "sha512-4FycO+BOTl2auLyF2Chvi6KTDqdsdDDtpaL/WHQMs8f3KS1E3loiUShQzAzFA/sMU5cJ0hz/RT1xum9YbG/zaA==" + }, "js-tokens@4.0.0": { "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, @@ -1400,6 +1404,7 @@ "npm:@preact/preset-vite@^2.9.1", "npm:autoprefixer@^10.4.20", "npm:babel-plugin-transform-hook-names@^1.0.2", + "npm:jotai@^2.10.1", "npm:less@^4.2.0", "npm:postcss@^8.4.47", "npm:preact@^10.24.3", diff --git a/server/main.ts b/server/main.ts index f5339f2..5d19ec5 100644 --- a/server/main.ts +++ b/server/main.ts @@ -98,7 +98,7 @@ router.route("/api/world") using store = new BearMetalStore(); const worldPath = store.get("world") as string; if (!worldPath) return new Response(null, { status: 400 }); - return serveFile(req, worldPath); + return new Response(worldPath.split("/").pop() as string, { status: 200 }); }); router.route("/api/pack") diff --git a/src/classes.ts b/src/classes.ts new file mode 100644 index 0000000..de25add --- /dev/null +++ b/src/classes.ts @@ -0,0 +1,3 @@ +export const classList = (...classes: (string | undefined)[]) => { + return classes.filter(Boolean).join(" "); +}; diff --git a/src/components/loader.tsx b/src/components/loader.tsx index ade0d1f..d2cf620 100644 --- a/src/components/loader.tsx +++ b/src/components/loader.tsx @@ -1,8 +1,17 @@ -export const Loader = ({ msg }: { msg?: string }) => { +import { classList } from "../classes.ts"; + +interface IProps { + msg?: string; + class?: string; +} + +export const Loader = ({ msg, class: className }: IProps) => { return ( -
{msg}
} -
+ {loading ?
+ {packVersionList.map((version) => (
+
+ )}
+
+ >
+ )}
+
- Datapack Version:{" "}
- setShowVersions(!showVersions)}
- >
- {packVersion}
- {showVersions && (
-
- {packVersionList.map((version) => (
-
- )}
-
-