Skip to content

Commit 4b26354

Browse files
committed
CopyableText can accept an alternative value for copying
1 parent 7f72589 commit 4b26354

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

apps/webapp/app/components/primitives/CopyableText.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,17 @@ import { SimpleTooltip } from "~/components/primitives/Tooltip";
44
import { useCopy } from "~/hooks/useCopy";
55
import { cn } from "~/utils/cn";
66

7-
export function CopyableText({ value, className }: { value: string; className?: string }) {
7+
export function CopyableText({
8+
value,
9+
copyValue,
10+
className,
11+
}: {
12+
value: string;
13+
copyValue?: string;
14+
className?: string;
15+
}) {
816
const [isHovered, setIsHovered] = useState(false);
9-
const { copy, copied } = useCopy(value);
17+
const { copy, copied } = useCopy(copyValue ?? value);
1018

1119
return (
1220
<span

0 commit comments

Comments
 (0)