Re-structured result components to use re-usable card

This commit is contained in:
Alicia Sykes
2023-07-05 01:46:59 +01:00
parent a6ecbd3406
commit fd7feada3a
17 changed files with 171 additions and 203 deletions

View File

@@ -23,36 +23,26 @@ const Row = styled.div`
}
`;
const DataRow = (props: { lbl: string, val: string }) => {
const { lbl, val } = props;
return (
<Row>
<span className="lbl">{lbl}</span>
<span className="val" title={val}>{val}</span>
</Row>
);
};
const ListRow = (props: { list: Technology[], title: string }) => {
const { list, title } = props;
return (
<>
<Heading as="h3" align="left" color={colors.primary}>{title}</Heading>
{ list.map((entry: Technology, index: number) => {
return (
<Row key={`${title.toLocaleLowerCase()}-${index}`}><span>{ entry.Name }</span></Row>
<>
<Heading as="h3" align="left" color={colors.primary}>{title}</Heading>
{ list.map((entry: Technology, index: number) => {
return (
<Row key={`${title.toLocaleLowerCase()}-${index}`}><span>{ entry.Name }</span></Row>
)}
)}
)}
</>
);
</>
);
}
const BuiltWithCard = (technologies: TechnologyGroup[]): JSX.Element => {
const BuiltWithCard = (props: { data: TechnologyGroup[]}): JSX.Element => {
// const { created, updated, expires, nameservers } = whois;
return (
<Outer>
<Heading as="h3" align="left" color={colors.primary}>Technologies</Heading>
{ technologies.map((group: TechnologyGroup) => {
{ props.data.map((group: TechnologyGroup) => {
return (
<ListRow key={group.tag} title={group.tag} list={group.technologies} />
);