fixed share link button

This commit is contained in:
2025-07-17 21:23:16 -04:00
parent 742a10fb9b
commit 3014c1f841

View File

@@ -1,14 +1,13 @@
export const ShareLinkButton = function ShareLinkButton({props}) {
const [text. setText] = useState("Share");
export const ShareLinkButton = function ShareLinkButton({ props }) {
const [text, setText] = useState("Share");
const onClickHandler = () => {
navigator.clipboard.writeText(location.href);
setText("Copied to clipboard!");
setTimeout(() => {
setText("Share");
}, 1000);
};
return (
<button onClick={onClickHandler}>
{text}
</button>
)
}
return <button onClick={onClickHandler}>{text}</button>;
};