;
visibleKeywords: string[];
@@ -19,6 +25,7 @@ type Props = {
};
export function DomainKeywordsTable({
+ domain,
rows,
selectedKeywords,
visibleKeywords,
@@ -105,33 +112,48 @@ export function DomainKeywordsTable({
) : (
- rows.slice(0, 100).map((row) => (
-
- |
- onToggleKeyword(row.keyword)}
- aria-label={`Select ${row.keyword}`}
- />
- |
- {row.keyword} |
- {row.position ?? "-"} |
- {formatNumber(row.searchVolume)} |
- {formatFloat(row.traffic)} |
- {row.cpc == null ? "-" : `$${row.cpc.toFixed(2)}`} |
-
- {row.relativeUrl ?? row.url ?? "-"}
- |
-
-
- |
-
- ))
+ rows.slice(0, 100).map((row) => {
+ const href = resolveDomainPageHref(
+ row.relativeUrl ?? row.url,
+ domain,
+ );
+
+ return (
+
+ |
+ onToggleKeyword(row.keyword)}
+ aria-label={`Select ${row.keyword}`}
+ />
+ |
+ {row.keyword} |
+ {row.position ?? "-"} |
+ {formatNumber(row.searchVolume)} |
+ {formatFloat(row.traffic)} |
+ {row.cpc == null ? "-" : `$${row.cpc.toFixed(2)}`} |
+
+ {href ? (
+
+ ) : (
+ "-"
+ )}
+ |
+
+
+ |
+
+ );
+ })
)}
diff --git a/src/client/features/domain/components/DomainPagesTable.tsx b/src/client/features/domain/components/DomainPagesTable.tsx
index 4ee4707..bf169f4 100644
--- a/src/client/features/domain/components/DomainPagesTable.tsx
+++ b/src/client/features/domain/components/DomainPagesTable.tsx
@@ -1,7 +1,9 @@
+import { SafeExternalLink } from "@/client/components/SafeExternalLink";
import { SortableHeader } from "@/client/features/domain/components/SortableHeader";
import {
formatFloat,
formatNumber,
+ resolveDomainPageHref,
toPageSortMode,
} from "@/client/features/domain/utils";
import type {
@@ -11,6 +13,7 @@ import type {
} from "@/client/features/domain/types";
type Props = {
+ domain: string;
rows: PageRow[];
sortMode: DomainSortMode;
currentSortOrder: SortOrder;
@@ -18,6 +21,7 @@ type Props = {
};
export function DomainPagesTable({
+ domain,
rows,
sortMode,
currentSortOrder,
@@ -55,15 +59,30 @@ export function DomainPagesTable({
) : (
- rows.slice(0, 100).map((row) => (
-
- |
- {row.relativePath ?? row.page}
- |
- {formatFloat(row.organicTraffic)} |
- {formatNumber(row.keywords)} |
-
- ))
+ rows.slice(0, 100).map((row) => {
+ const href = resolveDomainPageHref(
+ row.relativePath ?? row.page,
+ domain,
+ );
+
+ return (
+
+ |
+ {href ? (
+
+ ) : (
+ (row.relativePath ?? row.page)
+ )}
+ |
+ {formatFloat(row.organicTraffic)} |
+ {formatNumber(row.keywords)} |
+
+ );
+ })
)}
diff --git a/src/client/features/domain/components/DomainResultsCard.tsx b/src/client/features/domain/components/DomainResultsCard.tsx
index 0fb7436..3fb7567 100644
--- a/src/client/features/domain/components/DomainResultsCard.tsx
+++ b/src/client/features/domain/components/DomainResultsCard.tsx
@@ -205,6 +205,7 @@ export function DomainResultsCard({
{isKeywordsTab ? (
) : (