diff --git a/resources/js/Pages/Dashboard.tsx b/resources/js/Pages/Dashboard.tsx index 8f50580..efa66e6 100644 --- a/resources/js/Pages/Dashboard.tsx +++ b/resources/js/Pages/Dashboard.tsx @@ -1,26 +1,68 @@ import AuthenticatedLayout from '@/Layouts/AuthenticatedLayout'; import { Head } from '@inertiajs/react'; +import { useState } from 'react'; +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import { faArrowRight } from '@fortawesome/free-solid-svg-icons' + + +interface CustomerProps { + customers: [{ + id: number + name: string + }], +}; + +interface Customer { + id: number + name: string +}; + + + +export default function Dashboard({customers}: CustomerProps) { + const [searchItem, setSearchItem] = useState('') + const [filteredCustomers, setFilteredCustomers] = useState(customers) + + const handleInputChange = (e: any) => { + const searchTerm = e.target.value; + setSearchItem(searchTerm) + + const filteredItems = customers.filter((customer) => + customer.name.toLowerCase().includes(searchTerm.toLowerCase()) + ); + + setFilteredCustomers(filteredItems); + } -export default function Dashboard() { return ( - - Dashboard - - } - > + -
-
-
-
- You're logged in! +
+
+

Deltagare

+ +
+ {filteredCustomers && filteredCustomers.map( customer => { + return +

{customer.name}

+ + + +
+ })}
-
+ +
-
+ + ); }