import { cn } from '@/lib/utils'; import { dashboard } from '@/routes'; import { type SharedData } from '@/types'; import { __ } from '@/utils/i18n'; import { Link, usePage } from '@inertiajs/react'; import { BirdIcon, Github, StarIcon } from 'lucide-react'; import { useEffect, useState } from 'react'; import DiscordIcon from '../icons/DiscordIcon'; import { Button } from '../ui/button'; import { Separator } from '../ui/separator'; function useGitHubStars(): number | null { const [stars, setStars] = useState(null); useEffect(() => { fetch('https://api.github.com/repos/whisper-money/whisper-money') .then((res) => res.json()) .then((data) => { if (typeof data.stargazers_count === 'number') { setStars(data.stargazers_count); } }) .catch(() => { // Silently fail - stars will remain null }); }, []); return stars; } type Props = { canRegister?: boolean; hideAuthButtons?: boolean; hideExternalButtons?: boolean; }; export default function Header({ canRegister = false, hideAuthButtons = false, hideExternalButtons = false, }: Props) { const { auth } = usePage().props; const stars = useGitHubStars(); return ( <> {/* Mobile pill header */}
Whisper Money
{/* Desktop header */}
Whisper Money
); }