Next.js Hydration Error : Warning: Expected server HTML to contain a matching in

i am facing issue of hydration in my next.js application. while alot of trubleshooting i come to a result that , it might be because of the higher order component which is withAutch.js

the error says: Warning: Expected server HTML to contain a matching in .

screenshot of the error

Mentor dashboard

import BarChart from "@/components/mentor/chart/bar-chart/page";
import LineChart from "@/components/mentor/chart/line-chart/page";
import Image from "next/image";
import React from "react";
import "./page.scss";
import StdTable from "@/components/mentor/student-table/page";
import HowItWorksSection from "@/components/mentor/how-it-works/page";
import { useSelector } from "react-redux";

const MentorDash = () => {
  const user = useSelector((state) => state.auth.data.user);

  return (
    <main className="col-md-9 ms-sm-auto col-lg-10 p-mb p-0 mentor-profile">
      <div className="bg-screen position-relative">
        <div className="row py-4">
          <div className="col-sm-12">
            <h1 className="text-white">Welcome Back, {user.first_name} {user.last_name}.</h1>
          </div>
        </div>
        <div className="row g-3 py-3">
          <div className="col-sm-6 col-lg-3  ">
            <div className="p-3 bg-white rounded justify-content-between d-flex">
              <span>
                <p className="dashboard-p-label">Students</p>
                <h3>342</h3>
              </span>
              <Image src="/mentor-home/std.svg" height={60} width={60} />
            </div>
          </div>
          <div className="col-sm-6 col-lg-3  ">
            <div className="p-3 bg-white rounded d-flex justify-content-between">
              <span>
                <p className="dashboard-p-label">Awards</p>
                <h3>30+</h3>
              </span>
              <Image src="/mentor-home/award.svg" height={60} width={60} />
            </div>
          </div>
          <div className="col-sm-6 col-lg-3">
            <div className="p-3 bg-white rounded d-flex justify-content-between">
              <span>
                <p className="dashboard-p-label">Staff</p>
                <h3>312+</h3>
              </span>
              <Image src="/mentor-home/staff.svg" height={60} width={60} />
            </div>
          </div>
          <div className="col-sm-6 col-lg-3">
            <div className="p-3 bg-white rounded d-flex justify-content-between">
              <span>
                <p className="dashboard-p-label">Revenue</p>
                <h3>$34M</h3>
              </span>
              <Image src="/mentor-home/revenue.svg" height={60} width={60} />
            </div>
          </div>
        </div>
        <div className="row g-3 pb-3">
          <div className="col-sm-12 col-lg-6 rounded">
            <LineChart />
          </div>
          <div className="col-sm-12 col-lg-6 rounded">
            <BarChart />
          </div>
        </div>
        <div className="row g-1">
          <div className="col-sm-12">
            <StdTable />
          </div>
        </div>
        <HowItWorksSection />
      </div>
    </main>
  );
};

export default MentorDash;

mentor home code

"use client";
import React, { useState } from "react";
import "./page.scss";
import MentorDash from "@/components/mentor/dashboard/page";
import ProfileCompletion from "@/components/mentor/profile/page";
import WithAuth from "@/components/withAuth";

const MentorHome = () => {
  const [displayMentorDash, setDisplayMentorDash] = useState(true);

  const handleSwitchComponent = () => {
    setDisplayMentorDash(!displayMentorDash);
  };

  return (
    <>
      {displayMentorDash ? <MentorDash /> : <ProfileCompletion />}
      <button className="btn btn-lg btn-info" onClick={handleSwitchComponent}>
        Switch Component
      </button>
    </>
  );
};

export default WithAuth(MentorHome);

Higer order component

"use client";
import { useEffect, useRef } from "react";
import { useDispatch, useSelector } from "react-redux";
import { useRouter, usePathname } from "next/navigation";
import { logoutUser } from "@/app/Redux/slices/authSlice";

export default function WithAuth(Component) {
  return function WithAuth(props) {
    const router = useRouter();
    const pathname = usePathname().split("/");
    const token = useSelector((state) => state.auth.data.accessToken);
    const user = useSelector((state) => state.auth.data.user);
    const dispatch = useDispatch();

    const logoutTimerRef = useRef(null);

    useEffect(() => {
      if (!token) {
        router.push("/");
      }


    useEffect(() => {
      // Redirect logic based on user role and pathname
      if (user == null) {
        router.push("/");
      }
      if (user != null && user.role[0].id == 3 && pathname[1] == "mentor") {
        router.push("/student/home");
      }
      if (user != null && user.role[0].id == 2 && pathname[1] == "student") {
        router.push("/mentor/home");
      }
    }, [pathname, router, user]);

    return token ? <Component {...props} /> : null;
  };
}

i am unable to resolve this issue , can anyone please look into this

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật