@@ -4,8 +4,6 @@ import { useMemo, useState } from "react";
44import { keepPreviousData , useQuery } from "@tanstack/react-query" ;
55import {
66 Wallet ,
7- Copy ,
8- CheckCheck ,
97 ArrowDownLeft ,
108 ArrowUpRight ,
119 RefreshCw ,
@@ -15,6 +13,7 @@ import {
1513} from "lucide-react" ;
1614import { Card , CardHeader , CardTitle , CardContent } from "../../components/ui/Card" ;
1715import { Button } from "../../components/ui/Button" ;
16+ import { CopyButton } from "../../components/ui/CopyButton" ;
1817import { PaginationControls } from "../../components/ui/PaginationControls" ;
1918import { Spinner } from "../../components/global_ui/Spinner" ;
2019import { TransactionsSkeleton } from "../../components/skeletons/TransactionsSkeleton" ;
@@ -132,28 +131,6 @@ function useHorizonPayments(address: string, horizonUrl: string, cursor: string
132131 } ) ;
133132}
134133
135- // ─── Copy button ───────────────────────────────────────────────────────────────
136-
137- function CopyButton ( { value } : { value : string } ) {
138- const [ copied , setCopied ] = useState ( false ) ;
139- const handleCopy = ( ) => {
140- navigator . clipboard . writeText ( value ) . then ( ( ) => {
141- setCopied ( true ) ;
142- setTimeout ( ( ) => setCopied ( false ) , 2000 ) ;
143- } ) ;
144- } ;
145- return (
146- < button
147- onClick = { handleCopy }
148- className = "p-1.5 rounded-md text-zinc-400 hover:text-zinc-700 hover:bg-zinc-100 dark:hover:text-zinc-200 dark:hover:bg-zinc-800 transition-colors"
149- title = "Copy to clipboard"
150- aria-label = { copied ? "Copied to clipboard" : "Copy to clipboard" }
151- >
152- { copied ? < CheckCheck className = "h-4 w-4 text-green-500" /> : < Copy className = "h-4 w-4" /> }
153- </ button >
154- ) ;
155- }
156-
157134// ─── QR Code display ──────────────────────────────────────────────────────────
158135
159136function QRDisplay ( { address } : { address : string } ) {
0 commit comments