import React, { useEffect, useState } from "react" import { StarIcon, RepoForkedIcon } from "@primer/octicons-react" import logo from "../images/mdg.png" import links from "../constants/page-links" import gsap from "gsap" import axios from "axios" import { Link } from "gatsby" const Header = props => { const fetchData = async () => { var response = await axios.get( "https://api.github.com/repos/rahuldkjain/github-profile-readme-generator" ) const { stargazers_count, forks_count } = response.data setstats({ starsCount: stargazers_count, forksCount: forks_count, }) } const [stats, setstats] = useState({ starsCount: 0, forksCount: 0, }) useEffect(() => { fetchData() setInterval(fetchData, 60000) gsap.set(".star, .fork", { transformOrigin: "center", }) gsap.to(".star, .fork", { rotateZ: "360", duration: 2, ease: "elastic.inOut", repeat: -1, yoyo: true, }) }, []) return (