import React from 'react'; import { useGitHubStars } from '../hooks/useGitHubStars'; import { formatStarCount } from '../utils/formatNumber'; interface GitHubStarsButtonProps { username: string; repo: string; className?: string; } export function GitHubStarsButton({ username, repo, className = '' }: GitHubStarsButtonProps) { const { stars, isLoading, error } = useGitHubStars(username, repo); const repoUrl = `https://github.com/${username}/${repo}`; // Graceful degradation: on error, show just the icon (like original static link) if (error) { return ( ); } return ( {isLoading ? '...' : (stars !== null ? formatStarCount(stars) : '—')} ); }