11import React , { useState , useMemo , useCallback } from "react" ;
2- import { Button , Dropdown , Flex , Spin } from "antd" ;
2+ import { Button , Dropdown , Flex , Space , Spin } from "antd" ;
33import styles from "./styles.module.scss" ;
44import { FaAngleDown } from "react-icons/fa6" ;
55
@@ -39,7 +39,7 @@ const CopyDropdownButton: React.FC = () => {
3939 function copyHtml ( ) {
4040 setIsCopied ( true ) ;
4141 const htmlContent = getPageContentAsHtml ( ) ;
42- const markdownContent = convertHtmlToMarkdown ( htmlContent ) ;
42+ const markdownContent = convertHtmlToMarkdown ( htmlContent as string ) ;
4343 navigator . clipboard . writeText ( markdownContent ?. replace ( "Copy Page" , "" ) ) ;
4444 setTimeout ( ( ) => {
4545 setIsCopied ( false ) ;
@@ -71,7 +71,7 @@ const CopyDropdownButton: React.FC = () => {
7171 return (
7272 metadata ?. source ?. replace (
7373 "@site" ,
74- "https://raw.githubusercontent.com/databendlabs/databend-docs/refs/heads/main"
74+ "https://raw.githubusercontent.com/databendlabs/databend-docs/refs/heads/main" ,
7575 ) || ""
7676 ) ;
7777 } , [ metadata ] ) ;
@@ -134,15 +134,15 @@ const CopyDropdownButton: React.FC = () => {
134134 if ( key === "markdown" ) window . open ( sourceUrl , "_blank" ) ;
135135 if ( key === "gpt" )
136136 window . open (
137- `https://chat.openai.com/?hints=search&q=Read from ${ window . location . href } so I can ask questions about it.`
137+ `https://chat.openai.com/?hints=search&q=Read from ${ window . location . href } so I can ask questions about it.` ,
138138 ) ;
139139 if ( key === "claude" )
140140 window . open (
141- `https://claude.ai/new?q=Read from ${ window . location . href } so I can ask questions about it.`
141+ `https://claude.ai/new?q=Read from ${ window . location . href } so I can ask questions about it.` ,
142142 ) ;
143143 if ( key === "perplexity" ) {
144144 window . open (
145- `https://www.perplexity.ai/search/new?q=Read from ${ window . location . href } so I can ask questions about it`
145+ `https://www.perplexity.ai/search/new?q=Read from ${ window . location . href } so I can ask questions about it` ,
146146 ) ;
147147 }
148148 } ,
@@ -163,20 +163,18 @@ const CopyDropdownButton: React.FC = () => {
163163 </ span >
164164 </ Flex >
165165 ) ,
166- [ loading , isCopied ]
166+ [ loading , isCopied ] ,
167167 ) ;
168168
169169 return (
170- < Dropdown . Button
171- onClick = { ( ) => handleCopy ( sourceUrl ) }
172- menu = { menu }
173- placement = "bottomRight"
174- icon = { < FaAngleDown className = { styles . svg } /> }
175- className = { styles . buttonCainter }
176- trigger = { [ "click" ] }
177- >
178- { renderButtonContent }
179- </ Dropdown . Button >
170+ < Space . Compact className = { styles . buttonCainter } >
171+ < Button onClick = { ( ) => handleCopy ( sourceUrl ) } >
172+ { renderButtonContent }
173+ </ Button >
174+ < Dropdown menu = { menu } placement = "bottomRight" trigger = { [ "click" ] } >
175+ < Button icon = { < FaAngleDown className = { styles . svg } /> } />
176+ </ Dropdown >
177+ </ Space . Compact >
180178 ) ;
181179} ;
182180
0 commit comments