diff --git a/src/app/(tools)/(domain)/_components/domain-not-registered.tsx b/src/app/(tools)/(domain)/_components/domain-not-registered.tsx index f5c319d..da1c9e6 100644 --- a/src/app/(tools)/(domain)/_components/domain-not-registered.tsx +++ b/src/app/(tools)/(domain)/_components/domain-not-registered.tsx @@ -1,8 +1,7 @@ import Image from 'next/image'; import Link from 'next/link'; -import { XCircleIcon } from '@/components/icons/x-circle'; -import { Card } from '@/components/ui/card'; +import { ErrorState } from '@/components/error-state'; import { env } from '@/env'; interface DomainNotRegisteredProps { @@ -11,47 +10,45 @@ interface DomainNotRegisteredProps { export function DomainNotRegistered({ domain }: DomainNotRegisteredProps) { return ( - -
- -

- Domain not found -

-
+ Looks like the domain {domain}{' '} hasn't been registered yet. -
- {env.NEXT_PUBLIC_IS_MAIN_INSTANCE === '1' && ( - <> - + - + {result.error === 'domain_not_found' ? ( + + ) : ( + + Error code:{' '} + {result.error} +

+ } + /> + )} ); } diff --git a/src/components/error-state.tsx b/src/components/error-state.tsx new file mode 100644 index 0000000..8a0ac6f --- /dev/null +++ b/src/components/error-state.tsx @@ -0,0 +1,28 @@ +import type { PropsWithChildren } from 'react'; + +import { XCircleIcon } from './icons/x-circle'; +import { Card } from './ui/card'; + +interface ErrorStateProps extends PropsWithChildren { + title?: string; + description: JSX.Element; +} + +export function ErrorState({ + title = 'An unexpected error occurred.', + description, + children +}: ErrorStateProps) { + return ( + +
+ +

+ {title} +

+
{description}
+ {children} +
+
+ ); +}