"use client";

import { useState } from "react";
import { Bars3Icon, XMarkIcon } from "@heroicons/react/24/solid";
import NavPages from "./NavPages";

const Navbar = () => {
  const [menuActive, setMenuActive] = useState(false);

  return (
    <nav className="bg-primary-500 text-primary-100">
      <div className="mx-auto w-11/12 lg:w-5/6 flex justify-between items-center">
        <div className="font-cormorant text-2xl p-5">Richard A. Feely, DO</div>

        {/* Burger icon */}
        <div className="md:hidden w-[30px] text-tertiary-300">
          <Bars3Icon onClick={() => setMenuActive((e) => !e)}></Bars3Icon>
        </div>
        {/* Burger menu */}
        {menuActive ? (
          <div className="text-lg animate-fadeIn fixed bottom-0 right-0 z-50 h-full bg-secondary-500 drop-shadow-lg ">
            <div className="px-12 py-5 flex flex-col gap-6 text-primary-500 text-right">
              <div className="pb-3 flex justify-end ">
                <XMarkIcon
                  className="w-[30px]"
                  onClick={() => setMenuActive((e) => !e)}
                ></XMarkIcon>
              </div>
              <NavPages currentPageClasses="text-primary-100"></NavPages>
            </div>
          </div>
        ) : (
          <></>
        )}

        {/* Nav Bar */}
        <div className="hidden md:flex font-abel tems-center gap-6 p-5 text-lg text-tertiary-300">
          <NavPages currentPageClasses="text-secondary-500"></NavPages>
        </div>
      </div>
    </nav>
  );
};

export default Navbar;
