diff --git a/src/Explorer/QueryCopilot/V2/Header/Header.tsx b/src/Explorer/QueryCopilot/V2/Header/Header.tsx
index d464995ba..0286aab83 100644
--- a/src/Explorer/QueryCopilot/V2/Header/Header.tsx
+++ b/src/Explorer/QueryCopilot/V2/Header/Header.tsx
@@ -1,39 +1,81 @@
-import { IconButton, Image, Stack, Text } from "@fluentui/react";
+import { DefaultButton, IconButton, Image, Modal, PrimaryButton, Stack, Text } from "@fluentui/react";
import { useQueryCopilot } from "hooks/useQueryCopilot";
import React from "react";
import CopilotIcon from "../../../../../images/CopilotSidebarLogo.svg";
export const Header: React.FC = (): JSX.Element => {
- const { setShowCopilotSidebar } = useQueryCopilot();
+ const { setShowCopilotSidebar, chatMessages, setChatMessages, setShowExplanationBubble } = useQueryCopilot();
+ const [showDeleteHistoryModal, setShowDeleteHistoryModal] = React.useState(false);
+
+ const getDeleteHistoryModal = () => {
+ return (
+
+
+
+ Delete chat history?
+
+
+ This action will clear all chat history. Are you sure you want to continue?
+
+
+ {
+ setChatMessages([]);
+ setShowExplanationBubble(false);
+ setShowDeleteHistoryModal(false);
+ }}
+ >
+ Continue
+
+ setShowDeleteHistoryModal(false)}>
+ Close
+
+
+
+
+ );
+ };
return (
-
-
-
- Copilot
-
- Preview
-
+ <>
+
+
+
+ Copilot
+
+ Preview
+
+
+ setShowDeleteHistoryModal(true)}
+ iconProps={{ iconName: "History" }}
+ title="Delete history"
+ ariaLabel="Delete history"
+ style={{ color: "#424242", verticalAlign: "middle" }}
+ disabled={chatMessages.length === 0}
+ />
+ setShowCopilotSidebar(false)}
+ iconProps={{ iconName: "Cancel" }}
+ title="Exit"
+ ariaLabel="Exit"
+ style={{ color: "#424242", verticalAlign: "middle" }}
+ />
- setShowCopilotSidebar(false)}
- iconProps={{ iconName: "Cancel" }}
- title="Exit"
- ariaLabel="Exit"
- style={{ color: "#424242", verticalAlign: "middle" }}
- />
-
+ {getDeleteHistoryModal()}
+ >
);
};