"use client";

// import { description } from "@/config/default";
import { GoogleTagManager } from "@next/third-parties/google";
import { usePathname } from "next/navigation";
import React from "react";

const G_TagManager = ({ description }) => {
  const pathname = usePathname();

  const excludedPaths = ["/dashboard"];
  const shouldLoad = !excludedPaths.some((path) => pathname.startsWith(path));

  return (
    <>
      {description.googleTagId && shouldLoad && (
        <GoogleTagManager gtmId={description.googleTagId} />
      )}
    </>
  );
};

export default G_TagManager;
