diff --git a/app/sites/[id]/pagespeed/page.tsx b/app/sites/[id]/pagespeed/page.tsx index af19026..8d047ae 100644 --- a/app/sites/[id]/pagespeed/page.tsx +++ b/app/sites/[id]/pagespeed/page.tsx @@ -590,63 +590,17 @@ function AuditRow({ audit }: { audit: AuditSummary }) {
{audit.description}
+
+
{item.node.snippet}
- )}
- {/* Statistic-type items */}
- {!item.url && !item.node && item.statistic && (
- {item.statistic}
- )}
- + {audit.details.length - 10} more items
@@ -658,6 +612,94 @@ function AuditRow({ audit }: { audit: AuditSummary }) { ) } +// * Parse markdown-style links [text](url) into clickable tags +function AuditDescription({ text }: { text: string }) { + const parts = text.split(/(\[[^\]]+\]\([^)]+\))/g) + return ( + <> + {parts.map((part, i) => { + const match = part.match(/^\[([^\]]+)\]\(([^)]+)\)$/) + if (match) { + return ( + + {match[1]} + + ) + } + return {part} + })} + > + ) +} + +// * Render a single audit detail item — handles various field types from the PSI API +function AuditItem({ item }: { item: Record{item.node.snippet}
+ )}
+ {/* Fallback for items with only string values we haven't handled */}
+ {!label && !url && !text && !item.node && item.statistic && (
+ {item.statistic}
+ )}
+