-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dee4ac6
commit b4c26c7
Showing
3 changed files
with
94 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,47 @@ | ||
'use client'; | ||
|
||
const CertsError = () => ( | ||
<div className="flex items-center justify-center"> | ||
<p className="my-8">An error occurred!</p> | ||
</div> | ||
); | ||
import { Loader2 } from 'lucide-react'; | ||
import { revalidatePath } from 'next/cache'; | ||
import { useParams } from 'next/navigation'; | ||
import { type FC, useCallback, useEffect, useState } from 'react'; | ||
|
||
import { Button } from '@/components/ui/button'; | ||
|
||
type CertsErrorProps = { | ||
error: Error & { digest?: string }; | ||
reset: () => void; | ||
}; | ||
|
||
const CertsError: FC<CertsErrorProps> = ({ error }) => { | ||
const [isLoading, setLoading] = useState(false); | ||
const { domain } = useParams() as { domain: string }; | ||
|
||
useEffect(() => { | ||
console.error(error); | ||
}, [error]); | ||
|
||
const handleReset = useCallback(() => { | ||
setLoading(true); | ||
revalidatePath(`/lookup/${domain}/certs`); | ||
}, [domain]); | ||
|
||
return ( | ||
<div className="mt-12 flex flex-col items-center gap-2"> | ||
<h2>Something went wrong!</h2> | ||
<p className="mt-2 text-center text-sm text-muted-foreground"> | ||
Digest: {error.digest} | ||
</p> | ||
<Button | ||
className="mt-4" | ||
onClick={handleReset} | ||
disabled={isLoading} | ||
variant="outline" | ||
> | ||
{isLoading && <Loader2 className="mr-2 h-4 w-4 animate-spin" />} | ||
Try again | ||
</Button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default CertsError; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,47 @@ | ||
'use client'; | ||
|
||
const WhoisError = () => ( | ||
<div className="flex items-center justify-center"> | ||
<p className="my-8">An error occurred!</p> | ||
</div> | ||
); | ||
import { Loader2 } from 'lucide-react'; | ||
import { revalidatePath } from 'next/cache'; | ||
import { useParams } from 'next/navigation'; | ||
import { type FC, useCallback, useEffect, useState } from 'react'; | ||
|
||
import { Button } from '@/components/ui/button'; | ||
|
||
type WhoisErrorProps = { | ||
error: Error & { digest?: string }; | ||
reset: () => void; | ||
}; | ||
|
||
const WhoisError: FC<WhoisErrorProps> = ({ error }) => { | ||
const [isLoading, setLoading] = useState(false); | ||
const { domain } = useParams() as { domain: string }; | ||
|
||
useEffect(() => { | ||
console.error(error); | ||
}, [error]); | ||
|
||
const handleReset = useCallback(() => { | ||
setLoading(true); | ||
revalidatePath(`/lookup/${domain}/whois`); | ||
}, [domain]); | ||
|
||
return ( | ||
<div className="mt-12 flex flex-col items-center gap-2"> | ||
<h2>Something went wrong!</h2> | ||
<p className="mt-2 text-center text-sm text-muted-foreground"> | ||
Digest: {error.digest} | ||
</p> | ||
<Button | ||
className="mt-4" | ||
onClick={handleReset} | ||
disabled={isLoading} | ||
variant="outline" | ||
> | ||
{isLoading && <Loader2 className="mr-2 h-4 w-4 animate-spin" />} | ||
Try again | ||
</Button> | ||
</div> | ||
); | ||
}; | ||
|
||
export default WhoisError; |
b4c26c7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
domain-digger – ./
domain-digger-wotschofsky.vercel.app
domain-digger-git-main-wotschofsky.vercel.app
www.digger.tools
digger.tools