import Link from 'next/link'
import { FC } from 'react'
import { Button } from '../../components/Button';
import Cookies from 'js-cookie';
import { useRouter } from 'next/router';

interface Props {
}

export const Navbar:FC <Props> = () => {
  const router = useRouter();
 return (
   <>
   <div className="navbar">
    <div className="flex-none">
        <label htmlFor="my-drawer-2" className="btn btn-square btn-ghost drawer-button lg:hidden">
            <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" className="inline-block w-5 h-5 stroke-current"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M4 6h16M4 12h16M4 18h16"></path></svg>
        </label>
    </div>
    <div className="flex-1">
      <Link href={"/home"}>
        <img className="w-20 mr-4" src="/logo.png" alt="Sistema Agil" />
      </Link>
      
      
      
    </div>
    <div className="flex-none">
      <div className="dropdown dropdown-end">          
          <Button 
            title={'Logout'} 
            onClick={function (): void {
                  console.log("Logout")
                    Cookies.remove("token");
                    router.push("/login");
          }}/>

      </div>
    </div>
  </div>
   </>
 )
}