From 691aa744a0398f185b3ca98a36fbd83806c7786c Mon Sep 17 00:00:00 2001 From: Parker 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 ( +
+ + + + + + + + + + + {/* {links.map((link: any) => ( + + + + + + + ))} */} + +
LinkVisitsRedirectExpire Date
{link.url}{link.visits}{link.redirect}{link.expire_date}
+
+ ) +} + +export default Dashboard; \ No newline at end of file -- cgit v1.2.3-70-g09d2