diff --git a/src/pages/u/[username]/index.astro b/src/pages/u/[username]/index.astro index e96280c70..0dcdaa62c 100644 --- a/src/pages/u/[username]/index.astro +++ b/src/pages/u/[username]/index.astro @@ -1,4 +1,5 @@ --- +import { FrownIcon } from 'lucide-react'; import { userApi } from '../../../api/user'; import AccountLayout from '../../../layouts/AccountLayout.astro'; import { UserPublicProfilePage } from '../../../components/UserPublicProfile/UserPublicProfilePage'; @@ -16,11 +17,34 @@ const userClient = userApi(Astro as any); const { response: userDetails, error } = await userClient.getPublicProfile(username); +let errorMessage = ''; if (error || !userDetails) { - return Astro.redirect('/404'); + errorMessage = error?.message || 'User not found'; } --- - - + + {!errorMessage && } + { + errorMessage && ( +
+ + + 😞 + +

Problem loading user!

+

+ {errorMessage} +

+
+ ) + }