import React, {Component} from 'react'; import {Form, FormGroup, Label, Input} from 'reactstrap'; import {profileTexts} from '../../../constants/profileSettingsConstants'; class AddEditBillingAddress extends Component { constructor(props){ super(props); const address = this.props.params.address; this.state = { id: address.id, firstName: address.firstName || '', lastName: address.lastName || '', invoiceMail: address.invoiceMail || '', idCountrySelected: address.idCountrySelected || this.props.params.countries[0].idCountry, city: address.city || '', detailedAddress: address.detailedAddress || '', zipCode: address.zipCode || '' }; this.props.params.onAddressChange(this.state); this.handleChange = this.handleChange.bind(this); } handleChange(event) { const field = event.target.name; const address = Object.assign({}, this.state); address[field] = event.target.value; this.setState(address); this.props.params.onAddressChange(address); } render() { const {idCountrySelected, city, detailedAddress, zipCode, firstName, lastName, invoiceMail} = this.state; const {countries} = this.props.params; return (