{"size": 1444, "ext": "js", "max_stars_repo_path": "resources/js/components/Header.js", "max_stars_repo_name": "Allrivenjs/save_a_friend", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "resources/js/components/Header.js", "max_issues_repo_name": "Allrivenjs/save_a_friend", "max_issues_repo_issues_event_min_datetime": "2021-09-01T05:28:08.000Z", "max_issues_repo_issues_event_max_datetime": "2021-09-02T17:42:11.000Z", "max_forks_repo_path": "resources/js/components/Header.js", "max_forks_repo_name": "Allrivenjs/save_a_friend", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 5, "max_forks_count": null, "avg_line_length": 26.7407407407, "max_line_length": 88, "alphanum_fraction": 0.370498615}
import React from 'react';

import { Link } from 'react-router-dom';

import { FiUser } from 'react-icons/fi';

import Cookies from 'universal-cookie';

const cookies = new Cookies();

const Header = (props) => {

    const userToken = cookies.get('userToken');

    return (
        <div className="header">
            <Link to="/">
                <div className="header__logo">
                    🐶 Save a friend
                </div>
            </Link>
            
            <div className="header__btns">
                {userToken 
                ?
                <div>
                    <Link to="/profile">
                        <button className="btn-header flex justify-center items-center">
                            <FiUser />
                            <span className="ml-2"> Profile </span>
                        </button>
                    </Link>
                </div>
                : 
                <div>
                    <Link to="/login">
                        <button className="btn-header">
                            Login
                        </button>
                    </Link>

                    <Link to="/register">
                        <button className="btn-header">
                            Register
                        </button>
                    </Link>
                </div>
                }
            </div>
        </div>
    )
};

export default Header;