Skip to content

Full Toolkit for Next-Level Domain Analysis

Display message when no records are found 🙈

Felix Wotschofskyaeb4ad08d577
diff --git a/components/CertInfo.tsx b/components/CertInfo.tsx
index fa655d4..06210ad 100644
--- a/components/CertInfo.tsx
+++ b/components/CertInfo.tsx
@@ -7,6 +7,7 @@ import {
Table,
Tbody,
Td,
+ Text,
Th,
Thead,
Tooltip,
@@ -38,6 +39,14 @@ const CertInfo = ({ domain }: CertInfoProps) => {
return <p>An error occurred!</p>;
}
+ if (!data.certificates.length) {
+ return (
+ <Text textAlign="center" color="gray.500" mt={8}>
+ No issued certificates found!
+ </Text>
+ );
+ }
+
return (
<Table>
<Thead>
diff --git a/pages/lookup/[domain].tsx b/pages/lookup/[domain].tsx
index fd4057a..ee68848 100644
--- a/pages/lookup/[domain].tsx
+++ b/pages/lookup/[domain].tsx
@@ -10,6 +10,7 @@ import {
TabPanel,
TabPanels,
Tabs,
+ Text,
} from '@chakra-ui/react';
import { ExternalLinkIcon } from '@chakra-ui/icons';
@@ -94,7 +95,15 @@ const LookupDomain = ({
<TabPanels>
<TabPanel>
- <DnsTable records={records} />
+ {Object.values(records)
+ .map((r) => r.length)
+ .reduce((prev, curr) => prev + curr, 0) === 0 ? (
+ <Text textAlign="center" color="gray.500" mt={8}>
+ No DNS records found!
+ </Text>
+ ) : (
+ <DnsTable records={records} />
+ )}
</TabPanel>
<TabPanel>