text: import { Link } from "react-router-dom";
  import React, { useEffect, useState } from 'react';
  
  const Header = () => {
  
      let [loginStatus, setLoginStatus] = useState(false);
  
      useEffect(() => {
          setLoginStatus(sessionStorage.getItem('isUserLoggedIn'));
      }, []);
  
      if (loginStatus) {
          return (
              <header class="header sticky-top">
                  <nav class="navbar navbar-fixed-top navbar-expand-lg navbar-dark bg-dark">
                      <div class="container">
                          <Link className="navbar-brand" to="/">
                              <img src="https://3.imimg.com/data3/VT/AK/MY-2943984/dairy-management-software-250x250.jpg"
                                  height="24px" alt="Capgemini" />
                          </Link>
                          <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive">
                              <span class="navbar-toggler-icon"></span>
                          </button>
                          <div class="collapse navbar-collapse" id="navbarResponsive">
                              <ul class="navbar-nav ml-auto">
                                  <li className="nav-item">
                                      <Link className="nav-link" to="/customer" >Customer</Link>
                                  </li>
                                  <li className="nav-item">
                                      <Link className="nav-link" to="/spring" >Customer</Link>
                                  </li>
                                  <li className="nav-item">
                                      <Link className="nav-link" to="/logout" >Logout</Link>
                                  </li>
                              </ul>
                          </div>
                      </div>
                  </nav>
              </header>
          );
      }
      else {
          return (
              <header class="header sticky-top">
                  <nav class="navbar navbar-fixed-top navbar-expand-lg navbar-dark bg-dark">
                      <div class="container">
                          <Link className="navbar-brand" to="/">
                              <img src="https://3.imimg.com/data3/VT/AK/MY-2943984/dairy-management-software-250x250.jpg"
                                  height="24px" alt="Capgemini" />
                          </Link>
                          <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive">
                              <span class="navbar-toggler-icon"></span>
                          </button>
                          <div class="collapse navbar-collapse" id="navbarResponsive">
                              <ul class="navbar-nav ml-auto">
  
                                  <li className="nav-item">
                                      <Link className="nav-link" to="/register" >Register</Link>
                                  </li>
                                  <li className="nav-item">
                                      <Link className="nav-link" to="/login" >Login</Link>
                                  </li>
                              </ul>
                          </div>
                      </div>
                  </nav>
              </header>
          );
      }
  
  }
  
  export default Header;
  