Add copy to clip

This commit is contained in:
Owen
2025-10-30 16:17:20 -07:00
parent 444928dffd
commit b2cf152b9e
2 changed files with 21 additions and 6 deletions

View File

@@ -699,24 +699,24 @@ export default function GeneralPage() {
return ( return (
<div className="space-y-4"> <div className="space-y-4">
<div className="grid grid-cols-1 md:grid-cols-2 gap-4 text-xs"> <div className="grid grid-cols-1 md:grid-cols-2 gap-4 text-xs">
<div> {/* <div>
<strong>User Agent:</strong> <strong>User Agent:</strong>
<p className="text-muted-foreground mt-1 break-all"> <p className="text-muted-foreground mt-1 break-all">
{row.userAgent || "N/A"} {row.userAgent || "N/A"}
</p> </p>
</div> </div> */}
<div> <div>
<strong>Original URL:</strong> <strong>Original URL:</strong>
<p className="text-muted-foreground mt-1 break-all"> <p className="text-muted-foreground mt-1 break-all">
{row.originalRequestURL || "N/A"} {row.originalRequestURL || "N/A"}
</p> </p>
</div> </div>
<div> {/* <div>
<strong>Scheme:</strong> <strong>Scheme:</strong>
<p className="text-muted-foreground mt-1"> <p className="text-muted-foreground mt-1">
{row.scheme || "N/A"} {row.scheme || "N/A"}
</p> </p>
</div> </div> */}
<div> <div>
<strong>Metadata:</strong> <strong>Metadata:</strong>
<pre className="text-muted-foreground mt-1 text-xs bg-background p-2 rounded border overflow-auto"> <pre className="text-muted-foreground mt-1 text-xs bg-background p-2 rounded border overflow-auto">

View File

@@ -4,6 +4,7 @@ import { ColumnDef } from "@tanstack/react-table";
import { useTranslations } from "next-intl"; import { useTranslations } from "next-intl";
import { Badge } from "@app/components/ui/badge"; import { Badge } from "@app/components/ui/badge";
import { DNSRecordsDataTable } from "./DNSRecordsDataTable"; import { DNSRecordsDataTable } from "./DNSRecordsDataTable";
import CopyToClipboard from "@app/components/CopyToClipboard";
export type DNSRecordRow = { export type DNSRecordRow = {
id: string; id: string;
@@ -39,7 +40,15 @@ export default function DNSRecordsTable({
}, },
cell: ({ row }) => { cell: ({ row }) => {
const baseDomain = row.original.baseDomain; const baseDomain = row.original.baseDomain;
return <div>{baseDomain || "-"}</div>; return baseDomain ? (
<CopyToClipboard
text={baseDomain}
displayText={baseDomain}
isLink={false}
/>
) : (
<div>-</div>
);
} }
}, },
{ {
@@ -68,7 +77,13 @@ export default function DNSRecordsTable({
}, },
cell: ({ row }) => { cell: ({ row }) => {
const value = row.original.value; const value = row.original.value;
return <div>{value}</div>; return (
<CopyToClipboard
text={value}
displayText={value}
isLink={false}
/>
);
} }
}, },
{ {