{"size": 951, "ext": "js", "max_stars_repo_path": "src/form-input-password.js", "max_stars_repo_name": "otissv/react-uikit-form", "max_stars_repo_stars_event_min_datetime": "2016-06-27T03:28:48.000Z", "max_stars_repo_stars_event_max_datetime": "2018-01-15T09:58:11.000Z", "max_issues_repo_path": "src/form-input-password.js", "max_issues_repo_name": "otissv/react-uikit-form", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/form-input-password.js", "max_forks_repo_name": "otissv/react-uikit-form", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 4, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.0263157895, "max_line_length": 75, "alphanum_fraction": 0.6025236593}
import React from 'react';
import FormInputMain from './form-input-main';
import Icons from 'react-uikit-icons';


const FormInputPassword = (props) => {
  const icon = props.icon
    ? <Icons
        icon={props.icon || 'caret-down'}
        kitid={`icon-${props.kitid}`}
      />
    : null;

  return <div className='uk-form-password'>
          <FormInputMain {...props.input} type={props.type || 'password'}/>
          <a
            className='uk-form-password-toggle'
            onClick={props.onClick}
            data-kitid={`toggle-${props.kitid}`}
          >
            {props.body} {icon}
          </a>
        </div>;
};


FormInputPassword.propTypes = {
  body   : React.PropTypes.string,
  kitid  : React.PropTypes.string,
  icon   : React.PropTypes.string,
  input  : React.PropTypes.object,
  onClick: React.PropTypes.func,
  show   : React.PropTypes.bool,
  type   : React.PropTypes.string
};

export default FormInputPassword;
