import React from 'react';
import { Field } from 'react-final-form';

// Redux part
import { useSelector, useDispatch } from 'react-redux';
import { StoreState } from 'store/rootReducer';

// Import actions here

import classNames from 'classnames/bind';
import Input from 'components/formItems/Input';
import ProjectInput from 'components/formItems/ProjectInput';
import Button from 'components/items/Button';
import ProjectButton from 'components/items/ProjectButton';
import AddressFields from 'components/formItems/AddressFields';
import { required, email, composeValidators } from 'store/utils/validation';
import ProfileFields from 'components/formItems/ProfileFields';
import styleIdentifiers from './editPersonalInfoForm.scss';

const styles = classNames.bind(styleIdentifiers);

export interface StateProps {}

export interface DispatchProps {}

export interface OwnProps {
  onSubmit: Function;
}

export type EditPersonalInfoFormProps = StateProps & DispatchProps & OwnProps;

const EditPersonalInfoForm = (props: EditPersonalInfoFormProps) => {
  const { handleSubmit, submitting, valid } = props;

  // mapStateToProps

  return (
    <form className={styles('EditPersonalInfoForm')} onSubmit={handleSubmit}>
      <ProfileFields />
      <ProjectButton
        disabled={submitting || !valid}
        label="forms.profile.save"
        type="submit"
        color="primary"
      />
    </form>
  );
};

export default EditPersonalInfoForm;
