import React from 'react'; import { gettext, siteRoot } from '../../utils/constants'; const { defaultDevice, backupTokens } = window.app.pageOptions; class TwoFactorAuthentication extends React.Component { constructor(props) { super(props); } renderEnabled = () => { return (

{gettext('Status: enabled')}

{gettext('Disable Two-Factor Authentication')}

{gettext('If you don\'t have any device with you, you can access your account using backup codes.')} {backupTokens == 1 ? gettext('You have only one backup code remaining.') : gettext('You have {num} backup codes remaining.').replace('{num}', backupTokens)}

{gettext('Show Codes')}
); } renderDisabled = () => { return (

{gettext('Two-factor authentication is not enabled for your account. Enable two-factor authentication for enhanced account security.')}

{gettext('Enable Two-Factor Authentication')}
); } render() { return (

{gettext('Two-Factor Authentication')}

{defaultDevice ? this.renderEnabled() : this.renderDisabled()}
); } } export default TwoFactorAuthentication;