Total Complexity | 1 |
Complexity/F | 1 |
Lines of Code | 33 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
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 |