import { Navbar } from 'react-bootstrap'
import { Link } from 'react-router-dom'
import { CSSProperties } from 'react'

import { clearToken } from '../utils/auth'

import signOutIcon from '../assets/signOut.svg'

const styles = {
    rightIcon: {
        marginLeft: '1rem',
        marginRight: 0,
    } as CSSProperties,
}

const SignOut = () => (
    <Navbar.Brand style={styles.rightIcon} as={Link} to='/'>
        <img onClick={clearToken} src={signOutIcon} alt='Выйти' />
    </Navbar.Brand>
)

export default SignOut
