-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCustomTable.jsx
More file actions
31 lines (29 loc) · 789 Bytes
/
CustomTable.jsx
File metadata and controls
31 lines (29 loc) · 789 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
import "./styles.css";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faPenToSquare } from "@fortawesome/free-solid-svg-icons";
const CustomTable = ({ headers, data }) => {
return (
<table className="custom-table">
<thead>
<tr>
{headers.map((header, idx) => (
<th key={idx}>{header}</th>
))}
</tr>
</thead>
<tbody>
{data.map((user, idx) => (
<tr key={idx}>
<td>{user.name}</td>
<td>{user.email}</td>
<td>{user.phone_number}</td>
<td>
<FontAwesomeIcon icon={faPenToSquare} className="edit-icon" />
</td>
</tr>
))}
</tbody>
</table>
);
};
export default CustomTable;