import { StarFilledIcon, GitHubLogoIcon } from "@radix-ui/react-icons"; import Link from "next/link"; import { Button } from "@/components/ui/button"; import { NumberTicker } from "@/components/ui/number-ticker"; import type { Locale } from "@/core/i18n/locale"; import { getI18n } from "@/core/i18n/server"; import { env } from "@/env"; import { cn } from "@/lib/utils"; export type HeaderProps = { className?: string; homeURL?: string; locale?: Locale; }; export async function Header({ className, homeURL, locale }: HeaderProps) { const isExternalHome = !homeURL; const { locale: resolvedLocale, t } = await getI18n(locale); const lang = resolvedLocale.substring(0, 2); return (

DeerFlow


); } async function StarCounter() { let stars = 10000; // Default value try { const response = await fetch( "https://api.github.com/repos/bytedance/deer-flow", { headers: env.GITHUB_OAUTH_TOKEN ? { Authorization: `Bearer ${env.GITHUB_OAUTH_TOKEN}`, "Content-Type": "application/json", } : {}, next: { revalidate: 3600, }, }, ); if (response.ok) { const data = await response.json(); stars = data.stargazers_count ?? stars; // Update stars if API response is valid } } catch (error) { console.error("Error fetching GitHub stars:", error); } return ( <> {stars && ( )} ); }