diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..03d9549
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 72e5281..5aab73a 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,12 +4,28 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
{
"associatedIndex": 1
}
@@ -21,7 +37,9 @@
1733164121833
+
+
+
+
+
+
+
+
diff --git a/public/main.png b/public/main.png
new file mode 100755
index 0000000..b3456c0
Binary files /dev/null and b/public/main.png differ
diff --git a/src/app/helpers.tsx b/src/app/helpers.tsx
new file mode 100644
index 0000000..f37d913
--- /dev/null
+++ b/src/app/helpers.tsx
@@ -0,0 +1,5 @@
+export const getCookie = (name:string) => {
+ const cookieString = document.cookie;
+ const cookies = cookieString.split('; ').find(row => row.startsWith(name + '='));
+ return cookies ? cookies.split('=')[1] : null;
+};
\ No newline at end of file
diff --git a/src/app/images/upload/page.tsx b/src/app/images/upload/page.tsx
index a548e26..b7e820a 100644
--- a/src/app/images/upload/page.tsx
+++ b/src/app/images/upload/page.tsx
@@ -1,17 +1,63 @@
+"use client";
import "@radix-ui/themes/styles.css";
-import {Button, Text, Theme} from "@radix-ui/themes";
+import {useState} from "react";
+import {getCookie} from "@/app/helpers";
+
export default function Page() {
+ const [file, setFile] = useState(null);
+ const [message, setMessage] = useState('');
+
+ const handleFileChange = (e: any) => {
+ setFile(e.target.files[0]);
+ };
+
+ const handleUpload = async () => {
+ if (!file) {
+ setMessage('Please select a file first.');
+ return;
+ }
+
+ const formData = new FormData();
+ formData.append('file', file);
+
+ let apikey = ""
+ await fetch('http://localhost:7070/api/token', {
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
+ //@ts-expect-error
+ headers: {
+ 'Authorization': getCookie("access_token"),
+ }
+ }).then(res => res.json().then(data => {
+ console.log(data)
+ apikey = data.apiToken;
+ }));
+
+ try {
+ await fetch('http://localhost:7070/api/upload', {
+ method: 'POST',
+ body: formData,
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
+ //@ts-expect-error
+ headers: {
+ 'Authorization': apikey,
+ }
+ }).then(res => res.json().then(data => console.log(data)));
+
+ } catch (error) {
+ console.log(error);
+ }
+ };
+
return (
-
-
-
- upload a file
-
-
-
-
-
-
+
+
Upload a File
+
+
+ {message &&
{message}
}
+
);
+
}
\ No newline at end of file
diff --git a/src/app/main.css b/src/app/main.css
new file mode 100644
index 0000000..dde0c47
--- /dev/null
+++ b/src/app/main.css
@@ -0,0 +1,14 @@
+
+.logo {
+ width: 200px;
+}
+.leftside{
+ float: left;
+ margin-top: 5em;
+ margin-left: 5em;
+}
+.textleft{
+ float: left;
+ margin-top: 5em;
+ margin-left: 5em;
+}
\ No newline at end of file
diff --git a/src/app/page.tsx b/src/app/page.tsx
index 9d4a61d..c96c6c3 100644
--- a/src/app/page.tsx
+++ b/src/app/page.tsx
@@ -1,26 +1,19 @@
-
+import "./main.css"
+import { cookies } from 'next/headers'
import "@radix-ui/themes/styles.css";
-import {Avatar, Button, Heading, Text, Theme} from "@radix-ui/themes";
+import {Text, Theme} from "@radix-ui/themes";
-export default function Home() {
+export default async function Home() {
+ console.log((await cookies()).get("access_token"))
return (
-
-
- tappo
-
- bunch o fucking services that already exist so many fucking places
-
-
-
-
-
+
+

+
+
+ Tappo
+ Tappo
+
);
}