import { Button, FormLabel } from '@automattic/components'; import { localize } from 'i18n-calypso'; import PropTypes from 'prop-types'; import { Component } from 'react'; import FormButton from 'calypso/components/forms/form-button'; import FormFieldset from 'calypso/components/forms/form-fieldset'; import FormTextInput from 'calypso/components/forms/form-text-input'; class Security2faKeyAddName extends Component { static propTypes = { onNameSubmit: PropTypes.func.isRequired, onCancel: PropTypes.func.isRequired, }; state = { keyName: '', }; componentDidMount = () => { this.keyNameInput.focus(); }; submitName = ( e ) => { e.preventDefault(); this.props.onNameSubmit( this.state.keyName ); }; handleChange = ( e ) => { const { value } = e.currentTarget; this.setState( { keyName: value } ); }; render() { return (
); } } export default localize( Security2faKeyAddName );