Skip to content

Full Toolkit for Next-Level Domain Analysis

Fix markup related issues ✅

Felix Wotschofsky00fad6752e87
diff --git a/components/IpDetailsModal.tsx b/components/IpDetailsModal.tsx
index c2f0fb2..3ed84a1 100644
--- a/components/IpDetailsModal.tsx
+++ b/components/IpDetailsModal.tsx
@@ -10,6 +10,7 @@ import {
ModalOverlay,
Spinner,
Table,
+ Tbody,
Td,
Tr,
} from '@chakra-ui/react';
@@ -88,12 +89,14 @@ const IpDetailsModal = (props: IpDetailsModalProps) => {
) : (
<>
<Table>
- {mappedEntries.map((el) => (
- <Tr key={el.label + el.value}>
- <Td pl={0}>{el.label}</Td>
- <Td pr={0}>{el.value}</Td>
- </Tr>
- ))}
+ <Tbody>
+ {mappedEntries.map((el) => (
+ <Tr key={el.label + el.value}>
+ <Td pl={0}>{el.label}</Td>
+ <Td pr={0}>{el.value}</Td>
+ </Tr>
+ ))}
+ </Tbody>
</Table>
<chakra.div className={styles.mapWrapper} my={4}>
diff --git a/components/RecordRow.tsx b/components/RecordRow.tsx
index b7e017e..44e0fae 100644
--- a/components/RecordRow.tsx
+++ b/components/RecordRow.tsx
@@ -16,22 +16,26 @@ const RecordRow = ({ record }: { record: RawRecord }) => {
<Td>{record.TTL}</Td>
<Td>
{record.data}
+
{recordIsIp && (
- <IconButton
- variant="link"
- size="sm"
- ml={1}
- aria-label="Get IP Info"
- icon={<FaInfoCircle size="16px" />}
- onClick={onOpen}
- />
+ <>
+ <IconButton
+ variant="link"
+ size="sm"
+ ml={1}
+ aria-label="Get IP Info"
+ icon={<FaInfoCircle size="16px" />}
+ onClick={onOpen}
+ />
+ <IpDetailsModal
+ ip={record.data}
+ isOpen={isOpen}
+ onClose={onClose}
+ />
+ </>
)}
</Td>
</Tr>
-
- {recordIsIp && (
- <IpDetailsModal ip={record.data} isOpen={isOpen} onClose={onClose} />
- )}
</>
);
};
diff --git a/pages/lookup/[domain].tsx b/pages/lookup/[domain].tsx
index af8ae9a..4279db5 100644
--- a/pages/lookup/[domain].tsx
+++ b/pages/lookup/[domain].tsx
@@ -1,6 +1,7 @@
-import type { GetServerSideProps, InferGetServerSidePropsType } from 'next';
+import { Fragment } from 'react';
import { useRouter } from 'next/router';
import Head from 'next/head';
+import type { GetServerSideProps, InferGetServerSidePropsType } from 'next';
import {
Container,
Heading,
@@ -75,7 +76,7 @@ const LookupDomain = ({
}
return (
- <>
+ <Fragment key={recordType}>
<Heading
as="h2"
fontSize={{ base: 'xl', sm: '2xl' }}
@@ -95,11 +96,11 @@ const LookupDomain = ({
</Thead>
<Tbody>
{value.map((v) => (
- <RecordRow key={JSON.stringify(v)} record={v} />
+ <RecordRow key={v.type + v.data} record={v} />
))}
</Tbody>
</Table>
- </>
+ </Fragment>
);
})}
</Container>