/**
 * PasswordField component
 *
 * Generated by coz on 2016-10-14,
 * from a template provided by apeman-asset-templates.
 *
 * @function PasswordField
 */
'use strict'

import React from 'react'
import defineDebug from 'debug'
import {
  ApField,
  ApFieldLabel, ApFieldValue,
  ApPassword
} from 'apeman-react-basic'
const debug = defineDebug('project:fragment:password-field')

/** @lends PasswordField */
const PasswordField = ({ id, name, label, value, onUpdate }) => (
  <ApField className='password-field'>
    <ApFieldLabel htmlFor={ id }>
      { label }
    </ApFieldLabel>
    <ApFieldValue>
      <ApPassword id={ id }
                  value={ value }
                  name={ name }
                  onChange={ (e) => onUpdate({ [name]: e.target.value }) }
      />
    </ApFieldValue>
  </ApField>
)

export default PasswordField
