import {Layout, Spin} from "antd";
import {fakeFetchCrypto, fetchAssets, fetchUsers} from "../../api.js";
import {useEffect, useState} from "react";



const contentStyle = {
  textAlign: 'center',
  minHeight: 120,
  lineHeight: 'calc(100vh - 64px)',
  color: '#fff',
  backgroundColor: '#001529',
  padding: '1rem',
};



export default function AppContent() {
  const [loading, setLoading] = useState(true)
  const [users, setUsers] = useState([])
  const [assets, setAssets] = useState([])


  useEffect(() => {
    async function preload() {
      const result = await fetchUsers()

      setUsers(result)
      setLoading(false)
    }
    preload()
  }, []);

  if (loading) {
    return <Spin fullscreen/>
  }
  return (<Layout.Content style={contentStyle}>{users[0].email}</Layout.Content>)
}
