import React from 'react'
import PropTypes from 'prop-types'
import BEMModule from 'utils/bem'
import styles from './styles.scss'
import Logo from 'react-uikit/logo'
import {themes} from './constants'

const bem = new BEMModule(styles)

const LogoBar = ({theme, className}) => {
    const rootClasses = bem.classNames('c-logo-bar', className)
    const printClassNames = bem.classNames('c-logo-bar__print')
    const color = themes[theme]

    return (
        <nav className={rootClasses}>
            <a
                href="https://equitysim.com"
                rel="noopener noreferrer"
                target="_blank"
                title="EquitySim | Home"
            >
                <Logo
                    color={color}
                    mono={Boolean(theme)}
                    logoType
                    symbol
                    className={printClassNames}
                />
            </a>
        </nav>
    )
}

LogoBar.propTypes = {
    className: PropTypes.string,
    theme: PropTypes.oneOf(['dark', 'light']),
}

export default LogoBar
