import { Github } from '@/app/components/base/icons/src/public/common' import type { GithubRepo } from '@/models/common' const getStar = async () => { const res = await fetch('https://api.github.com/repos/langgenius/dify') if (!res.ok) throw new Error('Failed to fetch data') return res.json() } const GithubStar = async () => { let githubRepo: GithubRepo = { stargazers_count: 0 } if (process.env.NODE_ENV === 'development') return null try { githubRepo = await getStar() } catch (e) { return null } return (
Star
{`${githubRepo.stargazers_count}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}
) } export default GithubStar