diff --git a/src/app/[username]/components/BackgroundDecoration.tsx b/src/app/[username]/components/BackgroundDecoration.tsx
new file mode 100644
index 00000000..8eb457c7
--- /dev/null
+++ b/src/app/[username]/components/BackgroundDecoration.tsx
@@ -0,0 +1,11 @@
+export default function BackgroundDecoration() {
+ return (
+
+ );
+}
diff --git a/src/app/[username]/components/ErrorMessages.tsx b/src/app/[username]/components/ErrorMessages.tsx
new file mode 100644
index 00000000..b867c641
--- /dev/null
+++ b/src/app/[username]/components/ErrorMessages.tsx
@@ -0,0 +1,22 @@
+type Props = {
+ errors: { section: string; message: string }[];
+};
+
+export default function ErrorMessages({ errors }: Props) {
+ if (!errors || errors.length === 0) {
+ return null;
+ }
+
+ return (
+
+ {errors.map((err) => (
+
+ {err.section}: {err.message}
+
+ ))}
+
+ );
+}
diff --git a/src/app/[username]/components/UserSummaryGrid.tsx b/src/app/[username]/components/UserSummaryGrid.tsx
new file mode 100644
index 00000000..18bb8a37
--- /dev/null
+++ b/src/app/[username]/components/UserSummaryGrid.tsx
@@ -0,0 +1,52 @@
+import SkillsCard from "@/components/SkillsCard";
+import ContributionsCard from "@/components/ContributionsCard";
+import ReposCard from "@/components/ReposCard";
+import ActivityCard from "@/components/ActivityCard";
+import InterestsCard from "@/components/InterestsCard";
+import AnimatedWrapper from "@/components/AnimatedWrapper";
+import { UserSummary } from "@/lib/types";
+
+type Props = {
+ summary: UserSummary;
+};
+
+export default function UserSummaryGrid({ summary }: Props) {
+ return (
+
+ {/* Skills */}
+ {summary.repositories && (
+
+
+
+ )}
+
+ {/* Contributions */}
+ {summary.contributions && (
+
+
+
+ )}
+
+ {/* Repos */}
+ {summary.repositories && (
+
+
+
+ )}
+
+ {/* Interests */}
+ {summary.interests && (
+
+
+
+ )}
+
+ {/* Activity */}
+ {summary.activity && (
+
+
+
+ )}
+
+ );
+}
diff --git a/src/app/[username]/page.tsx b/src/app/[username]/page.tsx
index 17f1c5b0..43750adb 100644
--- a/src/app/[username]/page.tsx
+++ b/src/app/[username]/page.tsx
@@ -9,15 +9,14 @@ import { UserNotFoundError } from "@/lib/types";
import ShareButtons from "@/components/ShareButtons";
import CardGenerator from "@/components/CardGenerator";
import ProfileCard from "@/components/ProfileCard";
-import SkillsCard from "@/components/SkillsCard";
-import ContributionsCard from "@/components/ContributionsCard";
-import ReposCard from "@/components/ReposCard";
-import ActivityCard from "@/components/ActivityCard";
-import InterestsCard from "@/components/InterestsCard";
import AnimatedWrapper from "@/components/AnimatedWrapper";
import ThemeController from "@/components/ThemeController";
import MyPageBanner from "@/components/MyPageBanner";
+import BackgroundDecoration from "./components/BackgroundDecoration";
+import ErrorMessages from "./components/ErrorMessages";
+import UserSummaryGrid from "./components/UserSummaryGrid";
+
type Props = {
params: Promise<{ username: string }>;
};
@@ -62,30 +61,11 @@ export default async function UserPage({ params }: Props) {
topLanguageColor={summary.repositories?.languages[0]?.color}
/>
- {/* Background decoration */}
-
+
{/* Main */}
- {/* Errors */}
- {summary.errors.length > 0 && (
-
- {summary.errors.map((err) => (
-
- {err.section}: {err.message}
-
- ))}
-
- )}
+
@@ -105,43 +85,7 @@ export default async function UserPage({ params }: Props) {
)}
- {/* Grid */}
-
- {/* Skills */}
- {summary.repositories && (
-
-
-
- )}
-
- {/* Contributions */}
- {summary.contributions && (
-
-
-
- )}
-
- {/* Repos */}
- {summary.repositories && (
-
-
-
- )}
-
- {/* Interests */}
- {summary.interests && (
-
-
-
- )}
-
- {/* Activity */}
- {summary.activity && (
-
-
-
- )}
-
+
{/* Footer */}