diff --git a/src/components/ProfileCard.tsx b/src/components/ProfileCard.tsx
index 4d9d41b..fc379e6 100644
--- a/src/components/ProfileCard.tsx
+++ b/src/components/ProfileCard.tsx
@@ -4,6 +4,151 @@ type Props = {
profile: UserProfile;
};
+// Internal components for modularity
+const Avatar = ({ url, login }: { url: string; login: string }) => (
+
+
+

+
+);
+
+const ProfileMeta = ({ profile, joinDate }: { profile: UserProfile; joinDate: string }) => (
+
+);
+
+const ProfileStats = ({ profile }: { profile: UserProfile }) => (
+
+
+
+ {profile.followers.toLocaleString()}
+
+
Followers
+
+
+
+ {profile.following.toLocaleString()}
+
+
Following
+
+
+
+ {profile.public_repos.toLocaleString()}
+
+
Repos
+
+
+);
+
+const Organizations = ({ orgs }: { orgs: UserProfile["orgs"] }) => {
+ if (orgs.length === 0) return null;
+
+ return (
+
+ );
+};
+
+const PinnedRepos = ({ repos }: { repos: UserProfile["pinnedRepos"] }) => {
+ if (repos.length === 0) return null;
+
+ return (
+
+
Pinned Repositories
+
+
+ );
+};
+
export default function ProfileCard({ profile }: Props) {
const joinDate = new Date(profile.created_at).toLocaleDateString("en-US", {
year: "numeric",
@@ -13,17 +158,8 @@ export default function ProfileCard({ profile }: Props) {
return (
- {/* Avatar */}
-
-
-

-
+
- {/* Info */}
@@ -36,132 +172,13 @@ export default function ProfileCard({ profile }: Props) {
{profile.bio}
)}
- {/* Meta */}
-
-
- {/* Stats */}
-
-
-
- {profile.followers.toLocaleString()}
-
-
Followers
-
-
-
- {profile.following.toLocaleString()}
-
-
Following
-
-
-
- {profile.public_repos.toLocaleString()}
-
-
Repos
-
-
+
+
- {/* Organizations */}
- {profile.orgs.length > 0 && (
-
- )}
-
- {/* Pinned Repos */}
- {profile.pinnedRepos.length > 0 && (
-
-
Pinned Repositories
-
-
- )}
+
+
);
}