import { useEffect, useState } from "react";

export function useWakaTimeData() {
  const [wakaTimeData, setWakaTimeData] = useState<any>(null);

  useEffect(() => {
    const fetchWakaTimeData = async () => {
      try {
        const response = await fetch("https://api.imnya.ng/wakatime");
        const data = await response.json();
        setWakaTimeData(data);
      } catch (error) {
        console.error("Failed to fetch WakaTime data:", error);
      }
    };

    fetchWakaTimeData();
  }, []);

  return wakaTimeData;
}