style(new): ui *

This commit is contained in:
Eshan Roy
2024-12-07 19:57:20 +05:30
parent d5b90950f2
commit 8b818a4a6a
24 changed files with 5964 additions and 0 deletions

49
src/services/github.ts Normal file
View File

@@ -0,0 +1,49 @@
import { Octokit } from 'octokit';
const octokit = new Octokit();
export interface Maintainer {
login: string;
name: string | null;
avatarUrl: string;
bio: string | null;
location: string | null;
blog: string | null;
twitterUsername: string | null;
followers: number;
following: number;
}
export async function getMaintainers(): Promise<Maintainer[]> {
const maintainerUsernames = [
'ClementLefebvre',
'mtwebster',
'JosephMills',
'leigh123linux',
'xenopeek'
];
const maintainers = await Promise.all(
maintainerUsernames.map(async (username) => {
try {
const { data } = await octokit.rest.users.getByUsername({ username });
return {
login: data.login,
name: data.name,
avatarUrl: data.avatar_url,
bio: data.bio,
location: data.location,
blog: data.blog,
twitterUsername: data.twitter_username,
followers: data.followers,
following: data.following,
};
} catch (error) {
console.error(`Error fetching data for ${username}:`, error);
return null;
}
})
);
return maintainers.filter((m): m is Maintainer => m !== null);
}