import React from 'react';

import './style.scss';

export default class EmptyStateComponent extends React.Component {

    constructor(props) {
        super(props);
        this.props = props;
        this.state = {
          uniqId: (this.props.key) ? this.props.key : (new Date).getTime()
        };
        this.defaultState = Object.assign({}, this.state);
    }

    componentDidMount() {
      console.log(this.props);

      const ele = document.getElementById(this.state.uniqId);

      ele.style.top = (ele.clientHeight / 2) + 'px;'
    }

    render() {
        return (
            <div className="empty-state">
              <div id={this.state.uniqId} className="message-container">
                <img src="https://www.gstatic.com/mobilesdk/160505_mobilesdk/zerostate/2x/storage.png" alt="Empty" height="100" />
                <br/>
                {this.props.message}
              </div>
            </div>
        )
    }
}

