Skip to content

Commit

Permalink
remove old code
Browse files Browse the repository at this point in the history
  • Loading branch information
mckaywrigley committed Jan 19, 2024
1 parent 2856806 commit d3cf8b2
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,10 @@ import { ChatbotUISVG } from "@/components/icons/chatbotui-svg"
import { IconArrowRight } from "@tabler/icons-react"
import { useTheme } from "next-themes"
import Link from "next/link"
import { useEffect, useState } from "react"

export default function HomePage() {
const { theme } = useTheme()

const [stars, setStars] = useState(19000)

useEffect(() => {
getGitHubRepoStars()
}, [])

const getGitHubRepoStars = async () => {
const url = `https://api.github.com/repos/mckaywrigley/chatbot-ui`

try {
const response = await fetch(url, {
headers: {
Accept: "application/vnd.github.v3+json"
}
})

if (!response.ok) {
throw new Error(`Error: ${response.status}`)
}

const data = await response.json()
setStars(data.stargazers_count)
} catch (error) {
console.error("Failed to fetch GitHub stars:", error)
return 0
}
}

return (
<div className="flex h-screen w-screen flex-col items-center justify-center">
<div>
Expand Down

0 comments on commit d3cf8b2

Please sign in to comment.