import React, { PureComponent } from 'react';
import { View } from 'react-native';
import { WhiteSpace, List, Picker } from 'antd-mobile';

class PickerComponent extends PureComponent {
  onClick = () => {
    this.props.onClick();
  };
  onPickerChange = (val) => {
    this.props.onPickerChange(val);
  };
  render() {
    const { data, pathVal, cols } = this.props;
    return (
      <View>
        <WhiteSpace size="lg" />
        <List style={{ backgroundColor: 'white' }} className="picker-list">
          <Picker
            data={data}
            cols={3}
            value={pathVal}
            onPickerChange={this.onPickerChange}
            onOk={v => console.log(v)}
          >
            <List.Item arrow="horizontal" onClick={this.onClick}>当前基地</List.Item>
          </Picker>
        </List>
      </View>
    );
  }
}
export default PickerComponent;
