Landing Page

This commit is contained in:
David Haz
2025-07-08 12:39:14 +03:00
parent fa9392fa47
commit 9ddb731258
41 changed files with 4584 additions and 8 deletions

20
src/utils/utils.ts Normal file
View File

@@ -0,0 +1,20 @@
/**
* Fetches the star count for a GitHub repository
* @param repo - Repository in format "owner/repo"
* @returns Promise<number> - The star count
*/
export const getStarsCount = async (repo: string = 'DavidHDev/vue-bits'): Promise<number> => {
try {
const response = await fetch(`https://api.github.com/repos/${repo}`)
if (!response.ok) {
throw new Error(`GitHub API error: ${response.status}`)
}
const data = await response.json()
return data.stargazers_count || 0
} catch (error) {
console.error('Error fetching GitHub stars:', error)
throw error
}
}