Writes get robots, refactors row to be reusable, adds loading progress logic

This commit is contained in:
Alicia Sykes
2023-06-22 15:24:14 +01:00
parent 2a7a5fa0f9
commit 6062473efc
14 changed files with 335 additions and 136 deletions

View File

@@ -0,0 +1,35 @@
import styled from 'styled-components';
import colors from 'styles/colors';
import Card from 'components/Form/Card';
import Heading from 'components/Form/Heading';
import Row, { RowProps } from 'components/Form/Row';
const Outer = styled(Card)`
.content {
max-height: 20rem;
overflow-y: auto;
}
`;
const RobotsTxtCard = (props: { robotTxt: RowProps[] }): JSX.Element => {
return (
<Outer>
<Heading as="h3" size="small" align="left" color={colors.primary}>Crawl Rules</Heading>
<div className="content">
{
props.robotTxt.length === 0 && <p>No crawl rules found.</p>
}
{
props.robotTxt.map((row: RowProps, index: number) => {
return (
<Row key={row.key || `${row.lbl}-${index}`} lbl={row.lbl} val={row.val} />
)
})
}
</div>
</Outer>
);
}
export default RobotsTxtCard;