import MinecraftButton from "@/components/minecraft-button"; import { Skeleton } from "@/components/ui/skeleton"; import { StarIcon } from "@heroicons/react/24/outline"; import Link from "next/link"; import { ReactElement, Suspense } from "react"; /** * The button to display the amount * of stars the GitHub repository has. * * @returns the component jsx */ const GitHubStarButton = async (): Promise => { return ( {/* Star Count */} } > Star on GitHub ); }; /** * The github star count component. * * @returns the star count jsx */ const GitHubStarCount = async (): Promise => { const stars: number = await getStarCount(); // Get the repo star count return ( {stars} ); }; /** * Get the amount of stars * the repository has. * * @returns the star count */ const getStarCount = async (): Promise => { const response: Response = await fetch( "https://api.github.com/repos/Rainnny7/RESTfulMC", { next: { revalidate: 300 } } // Revalidate every 5 minutes ); const json: any = await response.json(); // Get the JSON response return json.stargazers_count; // Return the stars }; export default GitHubStarButton;