'use client' import { SiGithub } from '@icons-pack/react-simple-icons' import { StarIcon } from 'lucide-react' import Link from 'next/link' import { useEffect, useState } from 'react' interface StarsProps { mobileCompact?: boolean } /** * GitHub stars badge component with minimal bold styling * Features: Square corners, bold typography, hover effects * * @param props - Component props * @param props.mobileCompact - Whether to show compact version on mobile * @returns GitHub stars badge link component */ export function GithubStars({ mobileCompact = false }: StarsProps) { const [stars, setStars] = useState(null) useEffect(() => { const controller = new AbortController() fetch('https://api.github.com/repos/thedaviddias/llms-txt-hub', { signal: controller.signal }) .then(res => { if (!res.ok) { // Rate limited or other error - fail silently return null } return res.json() }) .then(data => { if (data?.stargazers_count) { setStars(data.stargazers_count) } }) .catch(error => { // Ignore abort errors - component was unmounted if (error.name === 'AbortError') { return } // Silently fail for other errors - component will just show without count }) return () => { controller.abort() } }, []) // Mobile compact variant if (mobileCompact) { return (