// @flow import React, { Component } from 'react'; import translate from 'translations'; import { isValidPrivKey } from 'libs/validators'; export type PrivateKeyValue = { key: string, password: string, valid: boolean }; function fixPkey(key) { if (key.indexOf('0x') === 0) { return key.slice(2); } return key; } export default class PrivateKeyDecrypt extends Component { props: { value: PrivateKeyValue, onChange: (value: PrivateKeyValue) => void, onUnlock: () => void }; render() { const { key, password } = this.props.value; const fixedPkey = fixPkey(key); const isValid = isValidPrivKey(fixedPkey.length); const isPassRequired = fixedPkey.length > 64; return (

{translate('ADD_Radio_3')}