import React, { Component } from 'react' import PropTypes from 'prop-types' import { MdSearch } from 'react-icons/lib/md' import styles from './StepOne.scss' class StepOne extends Component { constructor(props) { super(props); this.state = { peers: props.peers, searchQuery: '' } this.onSearchQuery = this.onSearchQuery.bind(this) this.peerClicked = this.peerClicked.bind(this) } onSearchQuery(searchQuery) { const peers = this.props.peers.filter(peer => peer.pub_key.includes(searchQuery)) this.setState({ peers, searchQuery }) } peerClicked(peer) { const { setNodeKey, changeStep } = this.props setNodeKey(peer.pub_key) changeStep(2) } render() { const { peers, searchQuery } = this.state return (