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

src/pages/Account.jsx   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 33
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 29
mnd 0
bc 0
fnc 1
dl 0
loc 33
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A Account.jsx ➔ fetchData 0 5 1
1
import React from "react";
2
import { Profile, History, Prepaid } from "../components";
3
import profile from "../models/profile.js"
4
import { useState, useEffect } from "react";
5
const Account = () => {
6
  const [userData, setUserData] = useState({});
7
8
  useEffect(() => {
9
    fetchData();
10
  }, []);
11
12
  async function fetchData() {
13
    const res = await profile.getUser();
14
    console.log(res);
15
    setUserData(res);
16
  }
17
  return (
18
    <>
19
      <div className="w-screen flex flex-col">
20
        <div className="w-screen bg-slate-400">
21
          <Profile userData={userData}/>
22
        </div>
23
        <div className="flex flex-row">
24
          <div className="w-2/3 bg-slate-800"><History userData={userData} /></div>
25
          <div className="w-1/3 bg-slate-900"><Prepaid /></div>
26
        </div>
27
      </div>
28
    </>
29
  );
30
};
31
32
export default Account;
33