import React, { useEffect, useState } from 'react'; import { CircularProgress } from '@material-ui/core'; import { ToastContainer, toast } from 'react-toastify'; import 'react-toastify/dist/ReactToastify.css'; import axios from 'axios'; import { useHistory } from 'react-router-dom'; const Parent = () => { const [parent, setParent ] = useState(null); const [loading, setLoading] = useState(true); const history = useHistory(); const state = history.location.state useEffect(() => { // axios.get('/api/children/listOfFather', {params: { father_id: 1 }}).then((response) => { // if(response.data.status_code==200){ // console.log(response.data.params); // setParent(response.data.params); // } else if(response.data.status_code==400){ // //TODO // } // setLoading(false); // if(state?.message) { // toast.success(state?.message, { // position: "top-center", // autoClose: 5000, // className:"bg-success", // hideProgressBar: true, // closeOnClick: true, // pauseOnHover: true, // draggable: false, // progress: undefined, // style:{ color: '#ffffff', opacity: 0.95} // }); // } // }); ///////////////////////////////////// var obj = [ {id:1, last_name:'山口', first_name:'太一', image:'/assets/img/avatar/avatar-sample03@2x.png', email:'mailaddress@info.com'}, {id:2, last_name:'山口', first_name:'太一', image:'/assets/img/avatar/avatar-sample03@2x.png', email:'mailaddress@info.com'}, {id:3, last_name:'山口', first_name:'太一', image:'/assets/img/avatar/avatar-sample03@2x.png', email:'mailaddress@info.com'}, {id:4, last_name:'山口', first_name:'太一', image:'/assets/img/avatar/avatar-sample03@2x.png', email:'mailaddress@info.com'}, {id:5, last_name:'山口', first_name:'太一', image:'/assets/img/avatar/avatar-sample03@2x.png', email:'mailaddress@info.com'} ]; setLoading(false); setParent(obj); //////////////////////////////////// }, []); return (