Passed
Push — dev ( 6ff2c1...2c3565 )
by Kasper
02:29 queued 13s
created

src/components/History.jsx   A

Complexity

Total Complexity 1
Complexity/F 0

Size

Lines of Code 34
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 28
mnd 1
bc 1
fnc 0
dl 0
loc 34
rs 10
bpm 0
cpm 0
noi 0
c 0
b 0
f 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;