import Pagination from '..';
import React from 'react';
import ReactDOM from 'react-dom';

interface IState {
  current: number;
}

class Demo extends React.Component<{}, IState> {
  constructor(props) {
    super(props);

    this.state = {
      current: 2,
    };

    this.handleChange = this.handleChange.bind(this);
  }

  handleChange(current) {
    this.setState({
      current,
    });
  }

  render() {
    return (
      <Pagination current={this.state.current} onChange={this.handleChange} />
    );
  }
}

ReactDOM.render(<Demo />, document.getElementById('pagination-demo-2'));
