src/components/Prepaid/PrepaidUses.jsx   A
last analyzed

Complexity

Total Complexity 1
Complexity/F 0

Size

Lines of Code 35
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 28
dl 0
loc 35
rs 10
c 0
b 0
f 0
wmc 1
mnd 1
bc 1
fnc 0
bpm 0
cpm 0
noi 0
1
import React from "react";
2
import { GrClose } from "react-icons/gr";
3
const PrepaidUses = ({ handleForm, logData }) => {
4
  const logList = () => {
5
    return logData.map((item, index) => {
6
      return (
7
        <div key={index} className="border-b border-gray-400 p-2 text-sm">
8
          <div className="flex flex-row justify-between">
9
            <p>{item}</p>
10
          </div>
11
        </div>
12
      );
13
    });
14
  };
15
  return (
16
    <div className="pb-2 px-2 bg-white w-72 h-131 rounded-xl shadow-md">
17
      <button className="py-1" onClick={() => handleForm()}>
18
        <GrClose />
19
      </button>
20
      <div>
21
        <h1 className="text-xl text-center pb-2">Log History</h1>
22
      </div>
23
      <div className=" bg-gray-200 w-full h-130 rounded-xl overflow-scroll">
24
        {logData ? (
25
          <div>{logList()}</div>
26
        ) : (
27
          <p className="py-2 text-center">Empty</p>
28
        )}
29
      </div>
30
    </div>
31
  );
32
};
33
34
export default PrepaidUses;
35