Skip to content

Commit

Permalink
fix(not-found-page): redirect link and status (#1561)
Browse files Browse the repository at this point in the history
  • Loading branch information
RemiBonnet authored Aug 12, 2024
1 parent b39ae51 commit d21c119
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { useOrganizations } from '@qovery/domains/organizations/feature'
import { ORGANIZATION_URL, USER_URL } from '@qovery/shared/routes'
import { Heading, Icon, Link, Section } from '@qovery/shared/ui'
import { type SerializedError } from '@qovery/shared/utils'

export function NotFoundPage({ error }: { error?: unknown }) {
const errorTyped = error as Error
const errorTyped = error as SerializedError

const { data: organizations = [] } = useOrganizations()

return (
<Section className="flex-grow items-center justify-center rounded-sm bg-white">
Expand All @@ -12,10 +17,15 @@ export function NotFoundPage({ error }: { error?: unknown }) {
alt="Event placeholder"
/>
<div>
<Heading className="font-medium text-neutral-400">{errorTyped?.name ?? '404'}</Heading>
<Heading className="font-medium text-neutral-400">{errorTyped?.name ?? errorTyped?.code}</Heading>
<p className="text-sm text-neutral-350">{errorTyped?.message ?? 'Not found'}</p>
</div>
<Link as="button" to="/" size="md" className="flex gap-2">
<Link
as="button"
to={organizations?.length > 0 ? ORGANIZATION_URL(organizations[0].id) : USER_URL}
size="md"
className="flex gap-2"
>
Go to correct URL
<Icon iconName="arrow-right" />
</Link>
Expand Down

0 comments on commit d21c119

Please sign in to comment.