Total Complexity | 1 |
Complexity/F | 0 |
Lines of Code | 34 |
Function Count | 0 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import React from "react"; |
||
2 | const History = ({ userData }) => { |
||
3 | const userInfo = () => { |
||
4 | return userData.arrayOverview |
||
5 | .map((item, index) => { |
||
6 | return ( |
||
7 | <tr key={index} className="border-b text-base border-gray-400"> |
||
8 | <td className="py-3 px-6">{index}</td> |
||
9 | <td className="py-3 px-6">{item.name}</td> |
||
10 | </tr> |
||
11 | ); |
||
12 | }); |
||
13 | }; |
||
14 | |||
15 | if (!userData.arrayOverview) { |
||
16 | return <div>Loading</div>; |
||
17 | } |
||
18 | |||
19 | return ( |
||
20 | <> |
||
21 | <table className="w-full text-lg content-between text-center"> |
||
22 | <thead className=" bg-sidebarBlue text-gray-200"> |
||
23 | <tr> |
||
24 | <th className="font-normal px-6">ID</th> |
||
25 | <th className="font-normal px-6">Name:</th> |
||
26 | </tr> |
||
27 | </thead> |
||
28 | <tbody>{userInfo()}</tbody> |
||
29 | </table> |
||
30 | </> |
||
31 | ); |
||
32 | }; |
||
33 | |||
34 | export default History; |