Skip to content

Commit 3bd83c2

Browse files
committed
fix: fix
1 parent d5fa895 commit 3bd83c2

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

modules/press-kit/CopyButton.tsx

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,19 @@ import { Copy } from '../icons/Copy';
55
import { Check } from '../icons/Check';
66
import styles from './PressKit.module.css';
77

8-
export function CopyButton({ value, path, label = 'Copier le lien' }: { value?: string; path?: string; label?: string }) {
8+
export function CopyButton({
9+
value,
10+
path,
11+
label = 'Copier le lien',
12+
}: {
13+
value?: string;
14+
path?: string;
15+
label?: string;
16+
}) {
917
const [copied, setCopied] = useState(false);
1018

1119
const handleCopy = async () => {
12-
const text = path ? `${window.location.origin}${path}` : value ?? '';
20+
const text = path ? `${window.location.origin}${path}` : (value ?? '');
1321
await navigator.clipboard.writeText(text);
1422
setCopied(true);
1523
setTimeout(() => setCopied(false), 2000);

0 commit comments

Comments
 (0)