diff --git a/bun.lockb b/bun.lockb index 8abce27..8516c27 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/src/App.tsx b/src/App.tsx index 4831e4a..01f3827 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -7,6 +7,7 @@ import DropZone from './components/DropZone'; import { Button } from './components/ui/button'; import { Context } from './Context'; import { processDataShopData } from './lib/dataProcessingUtils'; +import Loading from './components/Loading'; function App() { @@ -46,14 +47,9 @@ function App() {
- { loading ? -
-
-

Loading...

-
-
+ : ( showDropZone && ( diff --git a/src/components/Debug.tsx b/src/components/Debug.tsx index ddd96bc..715247f 100644 --- a/src/components/Debug.tsx +++ b/src/components/Debug.tsx @@ -1,7 +1,22 @@ -export default function Debug(){ - return( +import { GlobalDataType } from "@/lib/types"; +import { useState } from "react"; +import DropZone from "./DropZone"; + +export default function Debug() { + const [data, setData] = useState([]) + const handleData = (data: GlobalDataType[]) => { + setData(data) + console.log("Data from file: ", data); + + } + + const handleLoading = (loading: boolean) => { + } + + return ( <> - Debug Page + + ) } \ No newline at end of file diff --git a/src/components/DropZone.tsx b/src/components/DropZone.tsx index ba71f71..a1e9e2f 100644 --- a/src/components/DropZone.tsx +++ b/src/components/DropZone.tsx @@ -44,7 +44,7 @@ export default function DropZone({ afterDrop, onLoadingChange }: DropZoneProps) break; } const array: GlobalDataType[] | null = parseData(textStr, delimiter); - console.log("Array: ", array); + console.log("Array from file: ", array); // array is null when there is an error in the file structure or content if (!array) { @@ -71,8 +71,10 @@ export default function DropZone({ afterDrop, onLoadingChange }: DropZoneProps) }, [fileType, afterDrop, onLoadingChange]); const acceptedFileTypes: Accept = { - 'text/plain': ['.txt', '.csv', '.tsv', '.json', '.tsv', '.pipe'], - } + 'text/tab-separated-values': ['.tsv'], + 'text/csv': ['.csv'], + 'text/plain': ['.txt', '.csv', '.tsv', '.json', '.pipe'] + }; diff --git a/src/components/Loading.tsx b/src/components/Loading.tsx new file mode 100644 index 0000000..fbf48ec --- /dev/null +++ b/src/components/Loading.tsx @@ -0,0 +1,9 @@ +export default function Loading() { + return ( +
+
+

Loading...

+
+
+ ) +} \ No newline at end of file diff --git a/src/lib/routes.tsx b/src/lib/routes.tsx new file mode 100644 index 0000000..e7d8432 --- /dev/null +++ b/src/lib/routes.tsx @@ -0,0 +1,13 @@ +import App from "@/App"; +import Debug from "@/components/Debug"; + +export const routes = [ + { + path: "/", + element: , + }, + { + path: "/debug", + element: + } + ] \ No newline at end of file diff --git a/src/main.tsx b/src/main.tsx index e3bde4b..f19f1e7 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -12,19 +12,10 @@ import { createBrowserRouter, RouterProvider, } from "react-router-dom"; -import Debug from './components/Debug.tsx' +import { routes } from './lib/routes.tsx' const queryClient = new QueryClient() -const router = createBrowserRouter([ - { - path: "/", - element: , - }, - { - path: "/debug", - element: - } -]) +const router = createBrowserRouter(routes) ReactDOM.createRoot(document.getElementById('root')!).render(