- { file.ID.split("_").slice(1).join("_") || "Untitled" }
+ { file.Name || "Untitled" }
{ formatSize(file.Size) }
diff --git a/src/components/StereoLogo.tsx b/src/components/StereoLogo.tsx
new file mode 100644
index 0000000..892ea95
--- /dev/null
+++ b/src/components/StereoLogo.tsx
@@ -0,0 +1,9 @@
+import { component$, QwikIntrinsicElements } from "@builder.io/qwik";
+
+export default component$((props: QwikIntrinsicElements['svg']) => {
+ return (
+
+ )
+})
\ No newline at end of file
diff --git a/src/hooks/nanostores.ts b/src/hooks/nanostores.ts
index 3896ec4..4a91166 100644
--- a/src/hooks/nanostores.ts
+++ b/src/hooks/nanostores.ts
@@ -10,7 +10,7 @@ import {
} from "@builder.io/qwik";
import { Atom, WritableAtom } from "nanostores";
-function writeable
(store: Atom | WritableAtom): store is WritableAtom {
+function writeable(store: Atom | WritableAtom): store is WritableAtom {
return typeof (store as WritableAtom).set === 'function';
}
diff --git a/src/lib/api.ts b/src/lib/api.ts
index 5a0eafb..b25f5dc 100644
--- a/src/lib/api.ts
+++ b/src/lib/api.ts
@@ -14,10 +14,7 @@ export const api = {
formData.append('file', file);
return await client.post('upload', { body: formData });
},
- delete: async (file_id: string) => {
- console.log("Deleting file with ID:", file_id);
- return await client.delete(`delete`, {
- json: { file_id }
- }).json();
+ delete: async (uid: string, file: string) => {
+ return await client.delete(`${uid}/${file}`).json();
},
}
\ No newline at end of file
diff --git a/src/lib/stores.ts b/src/lib/stores.ts
index dc9c0b3..444b668 100644
--- a/src/lib/stores.ts
+++ b/src/lib/stores.ts
@@ -1,4 +1,5 @@
import { atom } from "nanostores";
import { StereoFile } from "./types";
-export const DashboardFiles = atom([]);
\ No newline at end of file
+export const areFilesLoaded = atom(false);
+export const dashboardFiles = atom([]);
\ No newline at end of file
diff --git a/src/lib/types.ts b/src/lib/types.ts
index 090fbd5..63354f2 100644
--- a/src/lib/types.ts
+++ b/src/lib/types.ts
@@ -1,5 +1,5 @@
export type StereoFile = {
- ID: string;
+ Name: string;
Owner: string;
CreatedAt: string;
Size: number;
diff --git a/src/routes/api/[path]/index.tsx b/src/routes/api/[...path]/index.tsx
similarity index 100%
rename from src/routes/api/[path]/index.tsx
rename to src/routes/api/[...path]/index.tsx
diff --git a/src/routes/index.tsx b/src/routes/index.tsx
index 9705b84..b807745 100644
--- a/src/routes/index.tsx
+++ b/src/routes/index.tsx
@@ -1,4 +1,4 @@
-import { component$, useSignal, useVisibleTask$ } from "@builder.io/qwik";
+import { component$, useVisibleTask$ } from "@builder.io/qwik";
import type { DocumentHead } from "@builder.io/qwik-city";
import Controlbar from "~/components/Controlbar";
import File from "~/components/File";
@@ -6,14 +6,14 @@ import { SolarUploadLinear, SvgSpinnersBarsRotateFade } from "~/components/Icons
import { useNanostore$ } from "~/hooks/nanostores";
import { api } from "~/lib/api";
import { OAUTH_LINK } from "~/lib/constants";
-import { DashboardFiles } from "~/lib/stores";
+import { areFilesLoaded, dashboardFiles } from "~/lib/stores";
import { StereoFile } from "~/lib/types";
// TODO: move this to dashboard/index.tsx
export default component$(() => {
- const files = useNanostore$(DashboardFiles);
- const loaded = useSignal(false);
+ const files = useNanostore$(dashboardFiles);
+ const loaded = useNanostore$(areFilesLoaded);
useVisibleTask$(async () => {
loaded.value = false;
@@ -43,7 +43,7 @@ export default component$(() => {
: (
{files.value.map((file) => (
-
+
))}
)