File tree Expand file tree Collapse file tree 1 file changed +5
-18
lines changed Expand file tree Collapse file tree 1 file changed +5
-18
lines changed Original file line number Diff line number Diff line change @@ -3,27 +3,14 @@ import Copy from "@/components/Copy";
33import Tooltip from "@radui/ui/Tooltip" ;
44
55const CodeWithCopy = ( { code } ) => {
6- const copyContent = code
7- . replace ( / \n { 2 , } / g, "\n" ) // Replace multiple newlines with single newline
8- . trim ( ) ; // Remove leading/trailing whitespace
9-
106 return (
117 < Code >
12- < span className = "flex items-center relative min-h-[2.06rem]" >
13- < span
14- className = { `whitespace-pre-wrap mr-10` }
15- style = { { wordBreak : "break-word" } }
16- >
17- { code }
8+ < span className = "flex items-center" >
9+ < span className = "mr-2" >
10+ { code }
11+ </ span >
12+ < Copy content = { code } />
1813 </ span >
19- < Tooltip
20- label = "Copy"
21- placement = "bottom"
22- className = "absolute top-0 right-0"
23- >
24- < Copy content = { copyContent } />
25- </ Tooltip >
26- </ span >
2714 </ Code >
2815 ) ;
2916} ;
You can’t perform that action at this time.
0 commit comments