"use client";

import { useEffect } from "react";
import { useAuth } from "@/components/AuthProvider";

export default function MonitoringInit() {
  const { user } = useAuth();

  useEffect(() => {
    import("@/lib/monitoring").then((mod) => {
      mod.initMonitoring();
    });
  }, []);

  useEffect(() => {
    if (!user) return;
    import("@/lib/monitoring").then((mod) => {
      mod.identifyUser(user);
    });
  }, [user]);

  return null;
}
