import moment from 'moment'; import React, { Component, PropTypes } from 'react'; import { If, Then, Else } from 'react-if'; import { Layout, Container, Header } from './Layout'; import { formatAccount } from '../lib/formatters'; import ExternalLinkSVG from '../assets/images/icon-extLink.svg'; export default class Account extends Component { static propTypes = { onLogout: PropTypes.func.isRequired, onClose: PropTypes.func.isRequired, onExternalLink: PropTypes.func.isRequired } onClose() { this.props.onClose(); } onExternalLink(type) { this.props.onExternalLink(type); } onLogout() { this.props.onLogout(); } render() { let paidUntil = moment(this.props.user.paidUntil); let formattedAccountId = formatAccount(this.props.user.account); let formattedPaidUntil = paidUntil.format('hA, D MMMM YYYY').toUpperCase(); let isOutOfTime = paidUntil.isSameOrBefore(moment()); return (