VendorDashboardSidebar.js 2.35 KB
import Image from "next/image";
import Link from "next/link";
import { useRouter } from "next/router";
import React, { useState } from "react";
import { ToastContainer } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
const Sidebar = () => {
  const router = useRouter();

  const [collapsed, setCollapsed] = useState(false);

  const toggleSidebar = () => {
    setCollapsed(!collapsed);
  };

  return (
    <div className={`sidebar ${collapsed ? "collapsed" : ""}`}>
      <ToastContainer position="bottom-right"></ToastContainer>

      {/* <button className="toggle-btn" onClick={toggleSidebar}>
        Toggle Sidebar
      </button> */}
      <ul>
        <li className={router.pathname === "/vendor/dashboard" ? "active" : ""}>
          <Link href="/vendor/dashboard">
            <span className="d-flex cursor-pointer">
              <Image className="" alt="" width={22} height={15} src="/images/vendor/icon-dashboard.svg" />
              <div className="mx-2 text-center">
                Dashboard
              </div>
            </span>
          </Link>
        </li>
        <li className={router.pathname === "/vendor/enquiries" ? "active" : ""}>
          <Link href="/vendor/enquiries">
            <span className="d-flex cursor-pointer">
              <Image alt="" width={22} height={15} src="/images/vendor/icon-orders.svg" />
              <div className="mx-2 text-center">
                Enquiries
              </div>
            </span>
          </Link>
        </li>
        <li className={router.pathname === "/vendor/activities" ? "active" : ""}>
          <Link href="/vendor/activities">
            <span className="d-flex cursor-pointer">
              <Image alt="" width={22} height={15} src="/images/vendor/icon-activities.svg" />
              <div className="mx-2 text-center">
                Activities
              </div>
            </span>
          </Link>
        </li>
        <li className={router.pathname === "/vendor/reviews" ? "active" : ""}>
          <Link href="/vendor/reviews">
            <span className="d-flex cursor-pointer">
              <Image alt="" width={22} height={15} src="/images/vendor/icon-orders.svg" />
              <div className="mx-2 text-center">
                Reviews
              </div>
            </span>
          </Link>
        </li>
      </ul>
    </div>
  );
};

export default Sidebar;