summaryrefslogtreecommitdiffhomepage
path: root/packages/web/src/components/share/copy-button.tsx
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-09-09 23:43:37 -0400
committerDax Raad <[email protected]>2025-09-09 23:44:04 -0400
commit38e8c42cf02f73fb300889ab989088899a3aedb7 (patch)
tree313db96535cf136cc1032618b43462c1f2f0e14c /packages/web/src/components/share/copy-button.tsx
parent58fe88432714456350244ebbea1e6287d3dccb36 (diff)
downloadopencode-38e8c42cf02f73fb300889ab989088899a3aedb7.tar.gz
opencode-38e8c42cf02f73fb300889ab989088899a3aedb7.zip
ci: format
Diffstat (limited to 'packages/web/src/components/share/copy-button.tsx')
-rw-r--r--packages/web/src/components/share/copy-button.tsx14
1 files changed, 3 insertions, 11 deletions
diff --git a/packages/web/src/components/share/copy-button.tsx b/packages/web/src/components/share/copy-button.tsx
index ad2e83b2e..892d5553f 100644
--- a/packages/web/src/components/share/copy-button.tsx
+++ b/packages/web/src/components/share/copy-button.tsx
@@ -11,8 +11,7 @@ export function CopyButton(props: CopyButtonProps) {
function handleCopyClick() {
if (props.text) {
- navigator.clipboard.writeText(props.text)
- .catch((err) => console.error("Copy failed", err))
+ navigator.clipboard.writeText(props.text).catch((err) => console.error("Copy failed", err))
setCopied(true)
setTimeout(() => setCopied(false), 2000)
@@ -21,15 +20,8 @@ export function CopyButton(props: CopyButtonProps) {
return (
<div data-component="copy-button" class={styles.root}>
- <button
- type="button"
- onClick={handleCopyClick}
- data-copied={copied() ? true : undefined}
- >
- {copied()
- ? <IconCheckCircle width={16} height={16} />
- : <IconClipboard width={16} height={16} />
- }
+ <button type="button" onClick={handleCopyClick} data-copied={copied() ? true : undefined}>
+ {copied() ? <IconCheckCircle width={16} height={16} /> : <IconClipboard width={16} height={16} />}
</button>
</div>
)