Skip to content

Commit f5137b5

Browse files
author
aoi-dev-0411
committed
feat: add empty state when no comparison is loaded (closes #26)
Show a friendly message with an illustration when no comparison result is loaded yet, guiding users to enter two GitHub usernames.
1 parent 60c8f15 commit f5137b5

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

app/page.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,30 @@ export default function HomePage() {
9393
</div>
9494
)}
9595
{data && <ResultDashboard user1={data.user1} user2={data.user2} />}
96+
{!loading && !error && !data && (
97+
<div className="flex flex-col items-center justify-center py-20 text-center text-muted-foreground gap-4">
98+
<svg
99+
xmlns="http://www.w3.org/2000/svg"
100+
width="64"
101+
height="64"
102+
viewBox="0 0 24 24"
103+
fill="none"
104+
stroke="currentColor"
105+
strokeWidth="1.5"
106+
strokeLinecap="round"
107+
strokeLinejoin="round"
108+
className="opacity-30"
109+
>
110+
<circle cx="9" cy="7" r="4" />
111+
<circle cx="15" cy="7" r="4" />
112+
<path d="M3 21v-2a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4v2" />
113+
</svg>
114+
<p className="text-lg font-medium">Enter two usernames to compare</p>
115+
<p className="text-sm opacity-70">
116+
Compare GitHub developer metrics side by side
117+
</p>
118+
</div>
119+
)}
96120
</div>
97121
</main>
98122
);

0 commit comments

Comments
 (0)