import React, { Component } from 'react'

export default class StatsNode extends Component {

  constructor(props) {
    super(props)
    this.state = {
      count: 0,
      loading: true,
    }
  }

  componentDidMount() {
    // call the db to get stats for this node
    // update state with it
    // set loading to false
  }

  render() {
    const { type } = this.props;
    const { count, loading } = this.state;

    if (loading) return <p>Loading...</p>
    
    return (
      <div>
        Stats for {type}: {count}
      </div>
    )
  }
}
