initial commit. gotta go
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
import React from "react";
|
||||
import { Button } from "./button";
|
||||
import { CheckIcon, ClipboardCopy } from "lucide-react";
|
||||
'use client';
|
||||
import React from 'react';
|
||||
import { Button } from './button';
|
||||
import { CheckIcon, ClipboardCopy } from 'lucide-react';
|
||||
|
||||
export const TextWithCopyButton: React.FC<{
|
||||
value: string;
|
||||
@@ -16,17 +16,17 @@ export const TextWithCopyButton: React.FC<{
|
||||
setIsCopied(true);
|
||||
setTimeout(() => setIsCopied(false), 2000); // Reset isCopied to false after 2 seconds
|
||||
} catch (err) {
|
||||
console.error("Failed to copy: ", err);
|
||||
console.error('Failed to copy: ', err);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={"flex gap-2 items-center group"}>
|
||||
<div className={'group flex items-center gap-2'}>
|
||||
<div className={className}>{value}</div>
|
||||
<Button
|
||||
variant="ghost"
|
||||
className={`hover:bg-transparent p-0 h-6 cursor-pointer text-muted-foreground ${
|
||||
alwaysShowCopy ? "opacity-100" : "opacity-0 group-hover:opacity-100"
|
||||
className={`text-muted-foreground h-6 cursor-pointer p-0 hover:bg-transparent ${
|
||||
alwaysShowCopy ? 'opacity-100' : 'opacity-0 group-hover:opacity-100'
|
||||
}`}
|
||||
onClick={copyToClipboard}
|
||||
>
|
||||
|
Reference in New Issue
Block a user