Writes get robots, refactors row to be reusable, adds loading progress logic
This commit is contained in:
35
src/components/Results/RobotsTxt.tsx
Normal file
35
src/components/Results/RobotsTxt.tsx
Normal 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;
|
||||
Reference in New Issue
Block a user