import { React } from "react" import { useState, useEffect } from "react"; import { ProfileForm } from "./ProfileForm"; export const Profile = () => { const [Users, fetchUsers] = useState([]) const [currentuser, setcurrentuser] = useState(localStorage.getItem("graphicsbaytracker_customer")) const [currentUsertrackedcards, setcurrentUsertrackedcards] = useState([]) const [formactive, setformstate] = useState(false) useEffect( () => { fetch("http://localhost:8088/trackedCards?_expand=cardData") .then(res => res.json()) .then(setcurrentUsertrackedcards) }, []) useEffect( () => { fetch("http://localhost:8088/users") .then(res => res.json()) .then(fetchUsers) }, []) // useEffect = ( // () = { // }, [currentUsertrackedcards] // ) const showprofileinfo = () => { const founduser = Users.find((user) => user.id === parseInt(currentuser)) return (
{founduser?.name}
{founduser?.email}
{showprofileinfo()}
| Brand | Model | Price |
|---|