Blame view

components/layout/VendorDashboardSidebar.js 1.81 KB
jaymehta committed
1
import Image from "next/image";
jaymehta committed
2
import Link from "next/link";
jaymehta committed
3 4 5 6
import { useRouter } from "next/router";
import React, { useState } from "react";
import { ToastContainer } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
7
const Sidebar = () => {
jaymehta committed
8 9 10
  const router = useRouter();

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

jaymehta committed
12 13 14
  const toggleSidebar = () => {
    setCollapsed(!collapsed);
  };
15

jaymehta committed
16 17 18
  return (
    <div className={`sidebar ${collapsed ? "collapsed" : ""}`}>
      <ToastContainer position="bottom-right"></ToastContainer>
19

jaymehta committed
20
      {/* <button className="toggle-btn" onClick={toggleSidebar}>
21 22
        Toggle Sidebar
      </button> */}
jaymehta committed
23 24
      <ul>
        <li className={router.pathname === "/vendor/dashboard" ? "active" : ""}>
jaymehta committed
25 26 27 28 29 30
          <span className="d-flex">
            <Image className="" alt="" width={22} height={15} src="/images/vendor/icon-dashboard.svg" />
            <div className="mx-2 text-center">
              <Link href="/vendor/dashboard">Dashboard</Link>
            </div>
          </span>
jaymehta committed
31
        </li>
jaymehta committed
32 33
        <li className={router.pathname === "/vendor/enquiries" ? "active" : ""}>
          <span className="d-flex">
jaymehta committed
34
            <Image alt="" width={22} height={15} src="/images/vendor/icon-orders.svg" />
jaymehta committed
35 36 37 38
            <div className="mx-2 text-center">
              <Link href="/vendor/enquiries">Enquiries</Link>
            </div>
          </span>
jaymehta committed
39 40
        </li>
        <li className={router.pathname === "/vendor/activities" ? "active" : ""}>
jaymehta committed
41
          <span className="d-flex">
jaymehta committed
42
            <Image alt="" width={22} height={15} src="/images/vendor/icon-activities.svg" />
jaymehta committed
43 44 45 46
            <div className="mx-2 text-center">
              <Link href="/vendor/activities">Activities</Link>
            </div>
          </span>
jaymehta committed
47 48 49 50
        </li>
      </ul>
    </div>
  );
51 52
};

jaymehta committed
53
export default Sidebar;