|
| 1 | +"use client"; |
| 2 | +import React, { useEffect, useState } from "react"; |
| 3 | +import { useRouter } from "next/navigation"; |
| 4 | +import Teste from "../components/account"; |
| 5 | +import ArrowBackIosIcon from "@mui/icons-material/ArrowBackIos"; |
| 6 | +import InfoTable from "../components/waitlist_table"; |
| 7 | +import Butt from "../components/button"; |
| 8 | + |
| 9 | +type UserInfo = { |
| 10 | + id: number; |
| 11 | + name: string; |
| 12 | + // Add more properties as needed |
| 13 | +}; |
| 14 | + |
| 15 | +function page() { |
| 16 | + useEffect(() => { |
| 17 | + // Set the title directly for the browser tab |
| 18 | + document.title = "Waitlist View"; |
| 19 | + }, []); |
| 20 | + |
| 21 | + const router = useRouter(); |
| 22 | + |
| 23 | + const handleBackButtonClick = () => { |
| 24 | + router.back(); |
| 25 | + }; |
| 26 | + |
| 27 | + const userData = [ |
| 28 | + { id: 1, name: "John Doe" }, |
| 29 | + { id: 2, name: "Jane Smith" }, |
| 30 | + { id: 101, name: "Gian Limbaga" }, |
| 31 | + { id: 102, name: "The Fourth" }, |
| 32 | + { id: 103, name: "Melaissa Rioveros" }, |
| 33 | + { id: 104, name: "Chen Leonor" }, |
| 34 | + { id: 105, name: "Eric Ramos" }, |
| 35 | + // Add more user data as needed |
| 36 | + ]; |
| 37 | + |
| 38 | + const [data, setData] = useState<UserInfo[]>(userData); |
| 39 | + const [filteredData, setFilteredData] = useState<UserInfo[]>(data); |
| 40 | + |
| 41 | + const handleDataSearch = (searchQuery: string) => { |
| 42 | + // Implement your filtering logic here |
| 43 | + const filteredResults = data.filter( |
| 44 | + (item) => |
| 45 | + item.name.toLowerCase().includes(searchQuery.toLowerCase()) || |
| 46 | + String(item.id).includes(searchQuery) // Convert id to string and check for inclusion |
| 47 | + ); |
| 48 | + |
| 49 | + setFilteredData(filteredResults); |
| 50 | + }; |
| 51 | + |
| 52 | + return ( |
| 53 | + <div className="flex min-h-full flex-col bg-backcolor"> |
| 54 | + <Teste |
| 55 | + backButtonIcon={<ArrowBackIosIcon style={{ fontSize: 20 }} />} |
| 56 | + onBackButtonClick={handleBackButtonClick} |
| 57 | + title="Waitlist View" |
| 58 | + subTitle1="" |
| 59 | + /> |
| 60 | + |
| 61 | + <div className="container bg-gray-200 rounded-lg mt-5 mb-3 text-xs"> |
| 62 | + <InfoTable data={filteredData} /> |
| 63 | + </div> |
| 64 | + |
| 65 | + <Butt title="Cancel" Bgcolor="#EBE0D0" width="325px" height="34px" /> |
| 66 | + </div> |
| 67 | + ); |
| 68 | +} |
| 69 | + |
| 70 | +export default page; |
0 commit comments