"use client";

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

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

  // Exclude dashboard and any other pages you don't want to track
  const excludedPaths = ["/dashboard"];
  const shouldTrack = !excludedPaths.some((path) => pathname.startsWith(path));

  return (
    <>
      {description.googleAnalyticsId && shouldTrack && (
        <GoogleAnalytics gaId={description.googleAnalyticsId} />
      )}
    </>
  );
};

export default G_Analytics;
