From d742339c1d5c8c1013abbc0e2322abf5f912caa5 Mon Sep 17 00:00:00 2001 From: "[dyad]" Date: Tue, 20 Jan 2026 16:26:30 +0100 Subject: [PATCH] [dyad] Added 'nofollow' warning to links - wrote 1 file(s) --- src/components/links-display.tsx | 102 +++++++++++++++++++------------ 1 file changed, 64 insertions(+), 38 deletions(-) diff --git a/src/components/links-display.tsx b/src/components/links-display.tsx index 67a6356..bfea710 100644 --- a/src/components/links-display.tsx +++ b/src/components/links-display.tsx @@ -12,7 +12,13 @@ import { } from "@/components/ui/table"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; -import { ExternalLink, Link as LinkIcon } from "lucide-react"; +import { ExternalLink, Link as LinkIcon, AlertTriangle } from "lucide-react"; +import { + Tooltip, + TooltipContent, + TooltipProvider, + TooltipTrigger, +} from "@/components/ui/tooltip"; import type { LinkData } from "@/app/actions"; interface LinksDisplayProps { @@ -88,44 +94,64 @@ export function LinksDisplay({ links }: LinksDisplayProps) { - {filteredLinks.map((link, index) => ( - - - - {link.type === "external" ? ( - - ) : ( - - )} - {link.href} - - - {link.text || "No anchor text"} - - - {link.type} - - - - {link.rel ? ( -
- {link.rel.split(" ").map((r) => ( - - {r} - - ))} + {filteredLinks.map((link, index) => { + const isMissingNoFollow = + link.type === "external" && !link.rel.includes("nofollow"); + return ( + + +
+ + {link.type === "external" ? ( + + ) : ( + + )} + {link.href} + + {isMissingNoFollow && ( + + + + + + +

+ External link without 'nofollow' attribute. +

+
+
+
+ )}
- ) : ( - "-" - )} -
-
- ))} + + {link.text || "No anchor text"} + + + {link.type} + + + + {link.rel ? ( +
+ {link.rel.split(" ").map((r) => ( + + {r} + + ))} +
+ ) : ( + "-" + )} +
+ + ); + })}