diff --git a/src/components/nostr/MarkdownContent.tsx b/src/components/nostr/MarkdownContent.tsx index d18a14c..8c3b78c 100644 --- a/src/components/nostr/MarkdownContent.tsx +++ b/src/components/nostr/MarkdownContent.tsx @@ -127,16 +127,23 @@ function CodeBlock({ }) { const { copy, copied } = useCopy(); + // Check if code is a single line (hide copy button for one-liners) + const isSingleLine = !code.includes("\n"); + return ( -
+)} -{code}copy(code)} copied={copied} /> + {!isSingleLine && ( + copy(code)} copied={copied} /> + )}