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

src/components/Profile.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 27
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
const Profile = ({ userData }) => {
2
  const userInfo = () => {
3
    return userData.arrayOverview
4
      .map((item, index) => {
5
        return (
6
          <tr key={index} className="border-b text-base border-gray-400">
7
            <td className="py-3 px-6">{index}</td>
8
            <td className="py-3 px-6">{item.name}</td>
9
          </tr>
10
        );
11
      });
12
  };
13
14
  if (!userData.arrayOverview) {
15
    return <div>Loading</div>;
16
  }
17
18
  return (
19
    <>
20
      <table className="w-full text-lg content-between text-center">
21
        <thead className=" bg-sidebarBlue text-gray-200">
22
          <tr>
23
            <th className="font-normal px-6">ID</th>
24
            <th className="font-normal px-6">Name:</th>
25
          </tr>
26
        </thead>
27
        <tbody>{userInfo()}</tbody>
28
      </table>
29
    </>
30
  );
31
};
32
33
export default Profile;
34