const { Motion, spring } = ReactMotion

export class Nombre extends React.Component {
  _getNumbers() {
    let numbers = []
    let i = 0

    while (i < 10) {
      numbers.push(<div>{i}</div>)
      i++
    }

    return numbers
  }

  render() {
    const { current } = this.props

    return (
      <div className="vote__column">
        <Motion
          style={{ y: spring(current * 10) }}
        >
          {({ y }) =>
            <div
              style={{
                transform: `translateY(${-y}%)`
              }}
            >
              {this._getNumbers()}
            </div>
          }
        </Motion>
      </div>
    )
  }
}
