import React, { Component } from 'react' import PropTypes from 'prop-types' import classnames from 'classnames' import { STATUS_CONNECTED, STATUS_CONNECTED_TO_ANOTHER_ACCOUNT, STATUS_NOT_CONNECTED, } from '../../../helpers/constants/connected-sites' export default class ConnectedStatusIndicator extends Component { static contextTypes = { t: PropTypes.func, } static propTypes = { status: PropTypes.oneOf([ STATUS_CONNECTED, STATUS_CONNECTED_TO_ANOTHER_ACCOUNT, STATUS_NOT_CONNECTED ]), onClick: PropTypes.func, } static defaultProps = { status: STATUS_NOT_CONNECTED, onClick: null, } renderStatusCircle = () => { const { status } = this.props return (
) } renderStatusText = () => { const { t } = this.context const { status } = this.props const text = status === STATUS_CONNECTED ? t('statusConnected') : t('statusNotConnected') return (
{ text }
) } render () { return ( ) } }