Skip to content

Commit 951ba4b

Browse files
authored
Ericnew (#36)
2 parents 0445bdd + c793643 commit 951ba4b

File tree

2 files changed

+109
-0
lines changed

2 files changed

+109
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import Link from "next/link";
2+
import React from "react";
3+
4+
type UserInfo = {
5+
id: number;
6+
name: string;
7+
// Add more properties as needed
8+
};
9+
10+
type InfoProps = {
11+
data: UserInfo[];
12+
};
13+
14+
function InfoTable({ data }: InfoProps) {
15+
return (
16+
<div className="overflow-x-auto">
17+
<table className="min-w-full bg-white border border-gray-300">
18+
<thead>
19+
<tr>
20+
<th className="py-2 px-4 border-b text-center">Order No.</th>
21+
<th className="py-2 px-4 border-b text-center">User ID</th>
22+
<th className="py-2 px-4 border-b text-center">User Name</th>
23+
</tr>
24+
</thead>
25+
<tbody>
26+
{data.map((item, index) => (
27+
<tr key={index} className={index % 2 === 0 ? "bg-gray-100" : ""}>
28+
<td className="py-2 px-4 border-b text-center">{index + 1}</td>
29+
<td className="py-2 px-4 border-b text-center">{item.id}</td>
30+
<td className="py-2 px-4 border-b text-center">{item.name}</td>
31+
</tr>
32+
))}
33+
</tbody>
34+
</table>
35+
</div>
36+
);
37+
}
38+
39+
export default InfoTable;

frontend/app/waitlist/page.tsx

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
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

Comments
 (0)