diff --git a/app/components/dashboard-layout.tsx b/app/components/dashboard-layout.tsx
index 422d765..66c6c01 100644
--- a/app/components/dashboard-layout.tsx
+++ b/app/components/dashboard-layout.tsx
@@ -54,7 +54,17 @@ export const DashboardLayout = ({ children }: React.PropsWithChildren<{}>) => {
Privacy
Ownership
-
+
{children}
@@ -89,97 +99,92 @@ export const DashboardLayout = ({ children }: React.PropsWithChildren<{}>) => {
)
}
-const UploadFileModal = () => {
- const { getRootProps, getInputProps, files, upload, removeFile, cancelAll } =
- useUppy({
- uploader: "tus",
- endpoint: import.meta.env.VITE_PUBLIC_TUS_ENDPOINT
- })
+const UploadFileForm = () => {
+ const {
+ getRootProps,
+ getInputProps,
+ getFiles,
+ upload,
+ state,
+ removeFile,
+ cancelAll
+ } = useUppy({
+ uploader: "tus",
+ endpoint: import.meta.env.VITE_PUBLIC_TUS_ENDPOINT
+ })
- const isUploading =
- files.length > 0
- ? files.map((file) => file.progress?.uploadStarted != null).includes(true)
- : false
- const isCompleted =
- files.length > 0
- ? files
- .map((file) => file.progress?.uploadComplete)
- .reduce((acc, cur) => acc && cur, true)
- : false
- const hasStarted = isUploading || isCompleted
+ console.log({ state, files: getFiles() })
+
+ const isUploading = state === "uploading"
+ const isCompleted = state === "completed"
+ const hasStarted = state !== "idle" && state !== "initializing"
return (
-