diff --git a/src/Explorer/Tabs/QueryTab/QueryResultSection.tsx b/src/Explorer/Tabs/QueryTab/QueryResultSection.tsx index 19d05d397..3240851d5 100644 --- a/src/Explorer/Tabs/QueryTab/QueryResultSection.tsx +++ b/src/Explorer/Tabs/QueryTab/QueryResultSection.tsx @@ -9,6 +9,7 @@ import { SelectionMode, Stack, Text, + IconButton, TooltipHost, } from "@fluentui/react"; import { HttpHeaders, NormalizedEventKey } from "Common/Constants"; @@ -24,6 +25,8 @@ import QueryEditorNext from "../../../../images/Query-Editor-Next.svg"; import RunQuery from "../../../../images/RunQuery.png"; import InfoColor from "../../../../images/info_color.svg"; import { QueryResults } from "../../../Contracts/ViewModels"; +import copy from "clipboard-copy"; +import CopilotCopy from "../../../../images/CopilotCopy.svg"; interface QueryResultProps { isMongoDB: boolean; @@ -352,6 +355,10 @@ export const QueryResultSection: React.FC = ({ return items; }; + const onClickCopyResults = (): void => { + copy(queryResultsString); + }; + return ( {isMongoDB && queryEditorContent.length === 0 && ( @@ -429,6 +436,17 @@ export const QueryResultSection: React.FC = ({ )} + {queryResults && queryResultsString?.length > 0 && !error && (