Full Toolkit for Next-Level Domain Analysis
Refactor WhoisInfo ✔
Felix Wotschofskye01b7d83ad06
diff --git a/components/WhoisInfo.tsx b/components/WhoisInfo.tsxindex c819106..4cb7c15 100644--- a/components/WhoisInfo.tsx+++ b/components/WhoisInfo.tsx@@ -13,24 +13,26 @@ const WhoisModal = (props: IpDetailsModalProps) => {`/api/lookupWhois?domain=${encodeURIComponent(props.domain)}`);+ if (!data) {+ return (+ <Flex justify="center" align="center">+ <Spinner size="xl" my={8} />+ </Flex>+ );+ }++ if (error) {+ return <p>An error occurred!</p>;+ }+return (- <>- {!data ? (- <Flex justify="center" align="center">- <Spinner size="xl" my={8} />- </Flex>- ) : error ? (- <p>An error occurred!</p>- ) : (- <chakra.code- css={css`- white-space: pre-wrap;- `}- >- {data.data}- </chakra.code>- )}- </>+ <chakra.code+ css={css`+ white-space: pre-wrap;+ `}+ >+ {data.data}+ </chakra.code>);};