Skip to content

Commit fd084c5

Browse files
Ai-chan-0411aoi-dev-0411
andauthored
feat: add empty state when no comparison is loaded (closes #26) (#51)
Show a friendly message with an illustration when no comparison result is loaded yet, guiding users to enter two GitHub usernames. Co-authored-by: aoi-dev-0411 <aoi@example.com>
1 parent 3bf55eb commit fd084c5

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
<footer className="border-t py-6 text-center text-sm text-muted-foreground">
98122
<div className="container max-w-7xl mx-auto px-4">

0 commit comments

Comments
 (0)