diff --git a/src/components/layout/Footer.tsx b/src/components/layout/Footer.tsx index 51fa8f8..e3feb64 100644 --- a/src/components/layout/Footer.tsx +++ b/src/components/layout/Footer.tsx @@ -1,7 +1,34 @@ -// import React from 'react'; +import React, { useEffect, useState } from 'react'; import { Github, Gitlab } from 'lucide-react'; export function Footer() { + const [githubFollowers, setGithubFollowers] = useState(null); + const [gitlabFollowers, setGitlabFollowers] = useState(null); + + // Fetch GitHub follower count + useEffect(() => { + async function fetchGithubFollowers() { + const response = await fetch('https://api.github.com/users/Snigdha-OS'); + const data = await response.json(); + if (data.followers !== undefined) { + setGithubFollowers(data.followers); + } + } + fetchGithubFollowers(); + }, []); + + // Fetch GitLab follower count + useEffect(() => { + async function fetchGitlabFollowers() { + const response = await fetch('https://gitlab.com/api/v4/users/Snigdha-OS'); + const data = await response.json(); + if (data[0]?.followers_count !== undefined) { + setGitlabFollowers(data[0].followers_count); + } + } + fetchGitlabFollowers(); + }, []); + return (