diff --git a/src/app/admin/Dashboard.tsx b/src/app/admin/Dashboard.tsx index f1757a1..c5ba414 100644 --- a/src/app/admin/Dashboard.tsx +++ b/src/app/admin/Dashboard.tsx @@ -1,84 +1,84 @@ 'use client'; -import { useEffect, useState } from "react"; +import { useEffect, useState } from 'react'; export default function Dashboard() { const [data, setData] = useState([]); const FAKE_DATA = [ { - "Client": "Attentive Aashita", - "Site Location": "Elgin", - "Delivery Status": "Delivered", - "Client Details": "Update" + Client: 'Attentive Aashita', + 'Site Location': 'Elgin', + 'Delivery Status': 'Delivered', + 'Client Details': 'Update', }, { - "Client": "Magnificent Michelle", - "Site Location": "Lockhart", - "Delivery Status": "Not Delivered", - "Client Details": "Update" + Client: 'Magnificent Michelle', + 'Site Location': 'Lockhart', + 'Delivery Status': 'Not Delivered', + 'Client Details': 'Update', }, { - "Client": "Awesome Ayah", - "Site Location": "McMahan", - "Delivery Status": "Not Delivered", - "Client Details": "Update" + Client: 'Awesome Ayah', + 'Site Location': 'McMahan', + 'Delivery Status': 'Not Delivered', + 'Client Details': 'Update', }, { - "Client": "Amazing Alisha", - "Site Location": "Trinity Lutheran", - "Delivery Status": "Delivered", - "Client Details": "OK" + Client: 'Amazing Alisha', + 'Site Location': 'Trinity Lutheran', + 'Delivery Status': 'Delivered', + 'Client Details': 'OK', }, { - "Client": "Phenomenal Pavan", - "Site Location": "Camine", - "Delivery Status": "Not Delivered", - "Client Details": "OK" + Client: 'Phenomenal Pavan', + 'Site Location': 'Camine', + 'Delivery Status': 'Not Delivered', + 'Client Details': 'OK', }, { - "Client": "Intricate Ismaeel", - "Site Location": "Camine", - "Delivery Status": "Delivered", - "Client Details": "OK" + Client: 'Intricate Ismaeel', + 'Site Location': 'Camine', + 'Delivery Status': 'Delivered', + 'Client Details': 'OK', }, { - "Client": "Jolly Joanne", - "Site Location": "Lockhart", - "Delivery Status": "Not Delivered", - "Client Details": "OK" + Client: 'Jolly Joanne', + 'Site Location': 'Lockhart', + 'Delivery Status': 'Not Delivered', + 'Client Details': 'OK', }, { - "Client": "Superb Sai", - "Site Location": "McMahan", - "Delivery Status": "Not Delivered", - "Client Details": "Update" + Client: 'Superb Sai', + 'Site Location': 'McMahan', + 'Delivery Status': 'Not Delivered', + 'Client Details': 'Update', }, { - "Client": "Magical Mi Lan", - "Site Location": "Trinity Lutheran", - "Delivery Status": "Delivered", - "Client Details": "OK" + Client: 'Magical Mi Lan', + 'Site Location': 'Trinity Lutheran', + 'Delivery Status': 'Delivered', + 'Client Details': 'OK', }, { - "Client": "Observant Omri", - "Site Location": "Flatonia", - "Delivery Status": "Not Delivered", - "Client Details": "Update" + Client: 'Observant Omri', + 'Site Location': 'Flatonia', + 'Delivery Status': 'Not Delivered', + 'Client Details': 'Update', }, { - "Client": "Meticulous Matthew", - "Site Location": "Trinity Lutheran", - "Delivery Status": "Delivered", - "Client Details": "OK" + Client: 'Meticulous Matthew', + 'Site Location': 'Trinity Lutheran', + 'Delivery Status': 'Delivered', + 'Client Details': 'OK', }, { - "Client": "Terrific Tiffany", - "Site Location": "Elgin", - "Delivery Status": "Delivered", - "Client Details": "OK" - } - ] - + Client: 'Terrific Tiffany', + 'Site Location': 'Elgin', + 'Delivery Status': 'Delivered', + 'Client Details': 'OK', + }, + ]; + useEffect(() => { // Replace this with appropriate API call when implementable // fetch('https://someapi.org/list/clients') @@ -88,31 +88,33 @@ export default function Dashboard() { }, []); // TODO: Replace with better looking loading screen - if (data.length === 0) return (
Loading...
); + if (data.length === 0) return
Loading...
; - const pets = ["Dog", "Cat", "Bird"].sort(); // Replace with actual logic later - const locations = Array.from(new Set(data.map((row: any) => row["Site Location"]))).sort(); + const pets = ['Dog', 'Cat', 'Bird'].sort(); // Replace with actual logic later + const locations = Array.from( + new Set(data.map((row: any) => row['Site Location'])) + ).sort(); return (
{/* Search area */}
- +