-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTable.jsx
More file actions
32 lines (30 loc) · 818 Bytes
/
Table.jsx
File metadata and controls
32 lines (30 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import "./styles.css";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faPenToSquare } from "@fortawesome/free-solid-svg-icons";
const Table = ({ headers, data }) => {
return (
<table className="admin-table">
<thead>
<tr>
{headers.map((header, idx) => (
<th key={idx}>{header}</th>
))}
</tr>
</thead>
<tbody>
{data.map((item, idx) => (
<tr key={idx}>
<td>{item.name}</td>
<td>{item.email}</td>
<td>{item.phone_number}</td>
<td>{item.message}</td>
<td>
<FontAwesomeIcon icon={faPenToSquare} className="admin-edit-icon" />
</td>
</tr>
))}
</tbody>
</table>
);
};
export default Table;