Skip to content

Commit d0ec592

Browse files
committed
Handle error case
1 parent cf2d107 commit d0ec592

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/pages/home/HomePage.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,18 @@ function PageBody() {
1717
queryKey: ["identity-detail"],
1818
queryFn: async () => {
1919
const response = await identityDetail()
20-
return response.data
20+
return response.data ?? null
2121
},
2222
staleTime: Infinity,
2323
gcTime: Infinity,
2424
})
2525

2626
if (!data) {
27-
return <>No identity found</>
27+
return (
28+
<div className="bg-card text-card-foreground rounded-lg border p-6">
29+
<div className="text-center text-muted-foreground">No identity found</div>
30+
</div>
31+
)
2832
}
2933

3034
return (

0 commit comments

Comments
 (0)