import { Checkbox, DefaultButton, IconButton, Link, Modal, PrimaryButton, Stack, Text, TextField, } from "@fluentui/react"; import Explorer from "Explorer/Explorer"; import { useCopilotStore } from "Explorer/QueryCopilot/QueryCopilotContext"; import { SubmitFeedback } from "Explorer/QueryCopilot/Shared/QueryCopilotClient"; import React from "react"; export const QueryCopilotFeedbackModal = ({ explorer, databaseId, containerId, mode, }: { explorer: Explorer; databaseId: string; containerId: string; mode: string; }): JSX.Element => { const { generatedQuery, userPrompt, likeQuery, showFeedbackModal, closeFeedbackModal, setHideFeedbackModalForLikedQueries, } = useCopilotStore(); const [description, setDescription] = React.useState(""); const [doNotShowAgainChecked, setDoNotShowAgainChecked] = React.useState(false); const handleSubmit = () => { closeFeedbackModal(); setHideFeedbackModalForLikedQueries(doNotShowAgainChecked); SubmitFeedback({ params: { generatedQuery, likeQuery, description, userPrompt }, explorer, databaseId, containerId, mode: mode, }); }; return (
Send feedback to Microsoft closeFeedbackModal()} /> Your feedback will help improve the experience. setDescription(newValue)} multiline rows={3} /> By pressing submit, your feedback will be used to improve Microsoft products and services. Please see the{" "} { Privacy statement }{" "} for more information. {likeQuery && ( setDoNotShowAgainChecked(checked)} /> )} Submit closeFeedbackModal()}>Cancel
); };