import { Card } from 'web-check-live/components/Form/Card'; import Row, { ExpandableRow } from 'web-check-live/components/Form/Row'; import colors from 'web-check-live/styles/colors'; const cardStyles = ` max-height: 50rem; overflow-y: auto; a { color: ${colors.primary}; } small { margin-top: 1rem; opacity: 0.5; display: block; a { color: ${colors.primary}; } } `; const SitemapCard = (props: {data: any, title: string, actionButtons: any }): JSX.Element => { const normalSiteMap = props.data.url || props.data.urlset?.url || null; const siteMapIndex = props.data.sitemapindex?.sitemap || null; const makeExpandableRowData = (site: any) => { const results = []; if (site.lastmod) { results.push({lbl: 'Last Modified', val: site.lastmod[0]}); } if (site.changefreq) { results.push({lbl: 'Change Frequency', val: site.changefreq[0]}); } if (site.priority) { results.push({lbl: 'Priority', val: site.priority[0]}); } return results; }; const getPathFromUrl = (url: string) => { try { const urlObj = new URL(url); return urlObj.pathname; } catch (e) { return url; } }; return ( { normalSiteMap && normalSiteMap.map((subpage: any, index: number) => { return () }) } { siteMapIndex &&

This site returns a sitemap index, which is a list of sitemaps.

} { siteMapIndex && siteMapIndex.map((subpage: any, index: number) => { return ({getPathFromUrl(subpage.loc[0])}); }) }
); } export default SitemapCard;