//@flow
import React, { Component } from 'react';
import { View } from 'react-native';
import { Button } from 'react-native-elements';
import Text from '../Text';
import ListItem from '../ListItem';

export default class SubmitButton extends Component {
  constructor(props) {
    super(props);
    this.state = {
      value: props.value,
    };
  }

  setPrem = (value) => {
    console.log('setPrem', value);
    this.setState({
      value,
    });
  }

  render() {
    return (
      <View style={{ flexDirection: 'row', height: 44, alignItems: 'stretch' }}>
        <View style={{
          width: global.SCREEN_WIDTH * 150 / 375,
          justifyContent: 'center',
          alignItems: 'center',
          flexDirection: 'row',
        }}
        >
          <Text style={{ color: '#666', fontSize: 16 }}>
            金额
          </Text>
          <Text style={{ color: '#FF4656', paddingLeft: 10 }}>{this.state.value}</Text>
        </View>
        <Button
          title="立即投保"
          containerStyle={{ width: global.SCREEN_WIDTH * 225 / 375 }}
          onPress={this.props.onPress}
        />
      </View>
    );
  }
}
