import React, { Component } from "react";

import MyButton from "../../components/MyButton/index.jsx";
import PessoasTabela from "../../components/PessoasTabela/index.jsx";

import "./index.less";

export default class DashboardContainer extends Component {
    constructor(props) {
        super(props);
        this.state = {
            counter: 0,
            data: []
        };
        this.button = React.createRef();
        this.click = this.click.bind(this);
    }

    componentWillMount() {
        /*
        // Basic sample of the service call:
        fetch('/services/my-test.netuno', {
            credentials: 'include'
        }).then((response) => {
            return response.json();
        }).then((json) => {
            // json...;
        });
        */
        
        
        // Better sample of the recommended way to call services:
    }

    componentDidUpdate(prevProps, prevState, snapshot) {
        $(this.button.current).fadeOut(250).fadeIn(250);
    }

    click() {
        this.setState({ counter: this.state.counter + 1 });
    }

    render() {
        const { counter, data } = this.state;
        return (
            <div className="my-dashboard">
                <PessoasTabela />
            </div>
        );
    }
}
