-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
88de8e4
commit 4761c9f
Showing
4 changed files
with
101 additions
and
5 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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
'use client'; | ||
|
||
import { type FC, useEffect } from 'react'; | ||
|
||
type GlobalErrorProps = { | ||
error: Error & { digest?: string }; | ||
reset: () => void; | ||
}; | ||
|
||
const GlobalError: FC<GlobalErrorProps> = ({ error }) => { | ||
useEffect(() => { | ||
console.error(error); | ||
}, [error]); | ||
|
||
return ( | ||
<div className="mt-12 flex flex-col items-center gap-2"> | ||
<h2>Something went VERY wrong!</h2> | ||
<p className="mt-2 text-center text-sm text-muted-foreground"> | ||
Digest: {error.digest} | ||
</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default GlobalError; |
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
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 |
---|---|---|
@@ -0,0 +1,68 @@ | ||
import { FC } from 'react'; | ||
import whoiser, { type WhoisSearchResult } from 'whoiser'; | ||
|
||
import { Skeleton } from './ui/skeleton'; | ||
|
||
type WhoisQuickInfoProps = { | ||
domain: string; | ||
}; | ||
|
||
const WhoisQuickInfo: FC<WhoisQuickInfoProps> = async ({ domain }) => { | ||
const results = await whoiser(domain, { | ||
timeout: 5000, | ||
}); | ||
const firstResult = results[ | ||
// @ts-expect-error | ||
Object.keys(results).filter((key) => !('error' in results[key]))[0] | ||
] as WhoisSearchResult; | ||
|
||
return ( | ||
<div className="my-8 flex gap-8"> | ||
<div> | ||
<h3 className="text-xs text-muted-foreground">Registrar</h3> | ||
<p className="text-sm"> | ||
{firstResult && 'Registrar' in firstResult | ||
? firstResult['Registrar'].toString() | ||
: 'Unavailable'} | ||
</p> | ||
</div> | ||
<div> | ||
<h3 className="text-xs text-muted-foreground">Creation Date</h3> | ||
<p className="text-sm"> | ||
{firstResult && 'Created Date' in firstResult | ||
? new Date( | ||
firstResult['Created Date'].toString() | ||
).toLocaleDateString('en-US') | ||
: 'Unavailable'} | ||
</p> | ||
</div> | ||
<div> | ||
<h3 className="text-xs text-muted-foreground">DNSSEC</h3> | ||
<p className="text-sm"> | ||
{firstResult && 'DNSSEC' in firstResult | ||
? firstResult['DNSSEC'].toString() | ||
: 'Unavailable'} | ||
</p> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default WhoisQuickInfo; | ||
|
||
export const WhoisQuickInfoPlaceholder: FC = () => ( | ||
<div className="my-8 flex gap-8"> | ||
<div> | ||
<h3 className="text-xs text-muted-foreground">Registrar</h3> | ||
<Skeleton className="mt-1 h-4 w-24 rounded-sm" /> | ||
</div> | ||
<div> | ||
<h3 className="text-xs text-muted-foreground">Creation Date</h3> | ||
<Skeleton className="w-18 mt-1 h-4 rounded-sm" /> | ||
</div> | ||
<div> | ||
<h3 className="text-xs text-muted-foreground">DNSSEC</h3> | ||
<Skeleton className="mt-1 h-4 w-16 rounded-sm" /> | ||
</div> | ||
</div> | ||
); |
4761c9f
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
digger.tools
www.digger.tools