Skip to content

Full Toolkit for Next-Level Domain Analysis

Use FC type ✨

Felix Wotschofsky751fce129199
diff --git a/app/layout.tsx b/app/layout.tsx
index 3cd3ba9..f39c5eb 100644
--- a/app/layout.tsx
+++ b/app/layout.tsx
@@ -1,4 +1,4 @@
-import type { ReactNode } from 'react';
+import type { FC, ReactNode } from 'react';
import Footer from '@/components/Footer';
import Header from '@/components/Header';
@@ -10,7 +10,7 @@ type RootLayoutProps = {
children: ReactNode;
};
-const RootLayout = ({ children }: RootLayoutProps) => {
+const RootLayout: FC<RootLayoutProps> = ({ children }) => {
return (
<html lang="en" suppressHydrationWarning>
<body>
diff --git a/app/lookup/[domain]/certs/page.tsx b/app/lookup/[domain]/certs/page.tsx
index c5da9f0..dbb7420 100644
--- a/app/lookup/[domain]/certs/page.tsx
+++ b/app/lookup/[domain]/certs/page.tsx
@@ -1,3 +1,5 @@
+import type { FC } from 'react';
+
import {
Table,
TableBody,
@@ -46,16 +48,18 @@ const lookupCerts = async (domain: string) => {
};
type CertsResultsPageProps = {
- params: { domain: string };
+ params: {
+ domain: string;
+ };
};
export const runtime = 'edge';
// crt.sh located in GB, always use LHR1 for lowest latency
export const preferredRegion = 'lhr1';
-const CertsResultsPage = async ({
+const CertsResultsPage: FC<CertsResultsPageProps> = async ({
params: { domain },
-}: CertsResultsPageProps) => {
+}) => {
const certs = await lookupCerts(domain);
if (!certs.length) {
diff --git a/app/lookup/[domain]/page.tsx b/app/lookup/[domain]/page.tsx
index 9aad772..efc248d 100644
--- a/app/lookup/[domain]/page.tsx
+++ b/app/lookup/[domain]/page.tsx
@@ -1,13 +1,17 @@
+import type { FC } from 'react';
+
import DnsTable from '@/components/DnsTable';
import DnsLookup from '@/utils/DnsLookup';
type LookupDomainProps = {
- params: { domain: string };
+ params: {
+ domain: string;
+ };
};
export const fetchCache = 'default-no-store';
-const LookupDomain = async ({ params: { domain } }: LookupDomainProps) => {
+const LookupDomain: FC<LookupDomainProps> = async ({ params: { domain } }) => {
const records = await DnsLookup.resolveAllRecords(domain);
return (
diff --git a/app/lookup/[domain]/whois/page.tsx b/app/lookup/[domain]/whois/page.tsx
index 2ac7693..2152092 100644
--- a/app/lookup/[domain]/whois/page.tsx
+++ b/app/lookup/[domain]/whois/page.tsx
@@ -1,4 +1,4 @@
-import { Fragment } from 'react';
+import { type FC, Fragment } from 'react';
import whoiser, { type WhoisSearchResult } from 'whoiser';
const lookupWhois = async (domain: string) => {
@@ -16,12 +16,14 @@ const lookupWhois = async (domain: string) => {
};
type WhoisResultsPageProps = {
- params: { domain: string };
+ params: {
+ domain: string;
+ };
};
-const WhoisResultsPage = async ({
+const WhoisResultsPage: FC<WhoisResultsPageProps> = async ({
params: { domain },
-}: WhoisResultsPageProps) => {
+}) => {
const data = await lookupWhois(domain);
return (
diff --git a/components/DnsTable.tsx b/components/DnsTable.tsx
index 79548f3..e74ac96 100644
--- a/components/DnsTable.tsx
+++ b/components/DnsTable.tsx
@@ -1,4 +1,4 @@
-import { Fragment } from 'react';
+import { type FC, Fragment } from 'react';
import {
Table,
@@ -15,7 +15,7 @@ type DnsTableProps = {
records: ResolvedRecords;
};
-const DnsTable = ({ records }: DnsTableProps) => (
+const DnsTable: FC<DnsTableProps> = ({ records }) => (
<>
{Object.keys(records).map((recordType) => {
const value = records[recordType];
diff --git a/components/LocationMap.tsx b/components/LocationMap.tsx
index 75def7b..c2e3d15 100644
--- a/components/LocationMap.tsx
+++ b/components/LocationMap.tsx
@@ -2,9 +2,14 @@ import type { LatLngExpression } from 'leaflet';
import 'leaflet-defaulticon-compatibility';
import 'leaflet-defaulticon-compatibility/dist/leaflet-defaulticon-compatibility.css';
import 'leaflet/dist/leaflet.css';
+import type { FC } from 'react';
import { MapContainer, Marker, TileLayer } from 'react-leaflet';
-const LocationMap = ({ location }: { location: LatLngExpression }) => (
+type LocationMapProps = {
+ location: LatLngExpression;
+};
+
+const LocationMap: FC<LocationMapProps> = ({ location }) => (
<MapContainer center={location} zoom={4}>
<TileLayer
attribution='&copy; <a href="http://osm.org/copyright" rel="noreferrer">OpenStreetMap</a> contributors'
diff --git a/components/RecordRow.tsx b/components/RecordRow.tsx
index 2ae4480..7e0f3f2 100644
--- a/components/RecordRow.tsx
+++ b/components/RecordRow.tsx
@@ -1,6 +1,6 @@
'use client';
-import type { ReactNode } from 'react';
+import type { FC, ReactNode } from 'react';
import reactStringReplace from 'react-string-replace';
import { TableCell, TableRow } from '@/components/ui/table';
@@ -14,7 +14,11 @@ const IPV4_REGEX = /(\d{1,3}\.){3}\d{1,3}/g;
const IPV6_REGEX =
/((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?/gi;
-const RecordRow = ({ record }: { record: RawRecord }) => {
+type RecordRowProps = {
+ record: RawRecord;
+};
+
+const RecordRow: FC<RecordRowProps> = ({ record }) => {
let interpolatedValue: ReactNode[] | string | null = record.data;
const domainMatches = record.data.match(DOMAIN_REGEX);