fix(public): fetch actual stars
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
|
import { getGithubRepoInfo } from '@/lib/github';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
import { useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { Button } from './ui/button';
|
import { Button } from './ui/button';
|
||||||
|
|
||||||
function formatStars(stars: number) {
|
function formatStars(stars: number) {
|
||||||
@@ -13,10 +14,10 @@ function formatStars(stars: number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function GithubButton() {
|
export function GithubButton() {
|
||||||
const [stars, setStars] = useState(3_100);
|
const [stars, setStars] = useState(3_263);
|
||||||
// useEffect(() => {
|
useEffect(() => {
|
||||||
// getGithubRepoInfo().then((res) => setStars(res.stargazers_count));
|
getGithubRepoInfo().then((res) => setStars(res.stargazers_count));
|
||||||
// }, []);
|
}, []);
|
||||||
return (
|
return (
|
||||||
<Button variant={'secondary'} asChild>
|
<Button variant={'secondary'} asChild>
|
||||||
<Link href="https://git.new/openpanel" className="hidden md:flex">
|
<Link href="https://git.new/openpanel" className="hidden md:flex">
|
||||||
|
|||||||
Reference in New Issue
Block a user