From 691aa744a0398f185b3ca98a36fbd83806c7786c Mon Sep 17 00:00:00 2001
From: Parker <contact@pkrm.dev>
Date: Sun, 10 Nov 2024 16:36:16 -0600
Subject: TOO MUCH STUFF

---
 app/src/components/Dashboard.tsx | 47 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)
 create mode 100644 app/src/components/Dashboard.tsx

(limited to 'app/src/components/Dashboard.tsx')

diff --git a/app/src/components/Dashboard.tsx b/app/src/components/Dashboard.tsx
new file mode 100644
index 0000000..bcab092
--- /dev/null
+++ b/app/src/components/Dashboard.tsx
@@ -0,0 +1,47 @@
+import { useState, useEffect } from 'react';
+import Axios from 'axios';
+import styles from '../styles/Dashboard.module.css';
+// import { accessAPI } from '../helpers/api';
+
+
+function Dashboard() {
+    // Get the links from the API
+    const [links, setLinks] = useState([]);
+    useEffect(() => {
+        Axios.get('/api/links')
+            .then((res) => {
+                setLinks(res.data);
+            })
+            .catch((err) => {
+                console.log(err);
+            });
+    }, []);
+
+
+    return (
+        <div id={styles.container}>
+            <table>
+                <thead>
+                    <tr style={{ border: '2px solid #ccc' }}>
+                        <th>Link</th>
+                        <th>Visits</th>
+                        <th>Redirect</th>
+                        <th>Expire Date</th>
+                    </tr>
+                </thead>
+                <tbody>
+                    {/* {links.map((link: any) => (
+                        <tr key={link.id}>
+                            <td>{link.url}</td>
+                            <td>{link.visits}</td>
+                            <td>{link.redirect}</td>
+                            <td>{link.expire_date}</td>
+                        </tr>
+                    ))} */}
+                </tbody>
+            </table>
+        </div>
+    )
+}
+
+export default Dashboard;
\ No newline at end of file
-- 
cgit v1.2.3-70-g09d2

