mirror of
https://github.com/Lissy93/web-check.git
synced 2025-08-16 23:51:11 +02:00
Adds components for displaying redirect and txt results
This commit is contained in:
37
src/components/Results/Redirects.tsx
Normal file
37
src/components/Results/Redirects.tsx
Normal file
@ -0,0 +1,37 @@
|
||||
|
||||
import styled from 'styled-components';
|
||||
import colors from 'styles/colors';
|
||||
import Card from 'components/Form/Card';
|
||||
import Heading from 'components/Form/Heading';
|
||||
import Row from 'components/Form/Row';
|
||||
|
||||
const Outer = styled(Card)`
|
||||
div {
|
||||
justify-content: flex-start;
|
||||
align-items: baseline;
|
||||
}
|
||||
.arrow-thing {
|
||||
color: ${colors.primary};
|
||||
font-size: 1.8rem;
|
||||
font-weight: bold;
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
`;
|
||||
|
||||
const RedirectsCard = (redirects: any): JSX.Element => {
|
||||
return (
|
||||
<Outer>
|
||||
<Heading as="h3" align="left" color={colors.primary}>Redirects</Heading>
|
||||
{ !redirects?.redirects.length && <Row lbl="" val="No redirects" />}
|
||||
{redirects.redirects.map((redirect: any, index: number) => {
|
||||
return (
|
||||
<Row lbl="" val="" key={index}>
|
||||
<span className="arrow-thing">↳</span> {redirect}
|
||||
</Row>
|
||||
);
|
||||
})}
|
||||
</Outer>
|
||||
);
|
||||
}
|
||||
|
||||
export default RedirectsCard;
|
25
src/components/Results/TxtRecords.tsx
Normal file
25
src/components/Results/TxtRecords.tsx
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
import styled from 'styled-components';
|
||||
import colors from 'styles/colors';
|
||||
import Card from 'components/Form/Card';
|
||||
import Heading from 'components/Form/Heading';
|
||||
import Row from 'components/Form/Row';
|
||||
|
||||
const Outer = styled(Card)``;
|
||||
|
||||
const TxtRecordCard = (records: any): JSX.Element => {
|
||||
console.log(records);
|
||||
return (
|
||||
<Outer>
|
||||
<Heading as="h3" align="left" color={colors.primary}>TXT Config</Heading>
|
||||
{ !records && <Row lbl="" val="No TXT Records" />}
|
||||
{Object.keys(records).map((recordName: any, index: number) => {
|
||||
return (
|
||||
<Row lbl={recordName} val={records[recordName]} key={`${recordName}-${index}`} />
|
||||
);
|
||||
})}
|
||||
</Outer>
|
||||
);
|
||||
}
|
||||
|
||||
export default TxtRecordCard;
|
Reference in New Issue
Block a user