//import { IoIosSearch } from "react-icons/io";
import { IoIosLock } from "react-icons/io";
import {Link} from 'react-router-dom';
import {useSelector} from 'react-redux'

const Navbar = () => {
    const {currentUser} = useSelector((state) => state.user)

  return (
    <header className="bg-blue-950">
        <div className="flex justify-between items-center mx-auto">
            <Link to="/">
                <div className="logo flex flex-col w-45 p-4 text-center bg-white sm:p-5 sm:w-50 ">
                    <h1 className=" text-blue-900 text-xl border-b-2 uppercase tracking-wide font-serif sm:text-2xl">Chicagoland</h1>
                    <h3 className=" text-gray-600 text-xs mt-1 uppercase tracking-widest">Lifestyle properties</h3>
                </div>
            </Link>
            {/*<form className="bg-white rounded-lg flex items-center">
                <input  type="text" placeholder="Search your dream property" className="bg-transparent px-4 py-2 focus:outline-none text-sm w-60 sm:w-64"/>
                <IoIosSearch className="text-slate-600 text-lg"/>
            </form>*/}
            <ul className="flex gap-4 sm:px-10">
                <Link to="/"><li className="text-white tracking-wide text-center uppercase text-sm hidden md:inline">Home</li></Link>
                <Link to="/"><li className="text-white tracking-wide text-center uppercase text-sm hidden md:inline">Buying</li></Link>
                <Link to="/"><li className="text-white tracking-wide text-center uppercase text-sm hidden md:inline">Selling</li></Link>
                <Link to="/contact"><li className="text-white tracking-wide text-center uppercase text-sm hidden md:inline">Contact</li></Link>
                <Link to="/profile" className="flex items-center gap-1">
                {currentUser ? (
                    <img className="rounded-full h-7 w-7 object-cover bg-blue-100" src={currentUser.avatar} alt="" />
                ): (
                    <li className="text-white tracking-wide text-center uppercase text-sm">Login <IoIosLock className="hidden md:inline"/></li>
                )}
                </Link>
                   
            </ul>
        </div>
        
    </header>
  )
}

export default Navbar