Adds components for displaying redirect and txt results

This commit is contained in:
Alicia Sykes
2023-06-29 00:30:06 +01:00
parent 3adfbb2a67
commit 4f0ebdd35e
3 changed files with 91 additions and 1 deletions

View 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;

View 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;