Elffuss BraidHub

kikocis/continue public

972ea8cfaef0 · 1.1 KiBRawPermalink
1import { useContext } from "react";
2import { IdeMessengerContext } from "../../../../context/IdeMessenger";
3import { getAltKeyLabel, getMetaKeyLabel } from "../../../../util";
4import { Container, StopButton } from "./components";
5import { GeneratingIndicator } from "./GeneratingIndicator";
6
7export const IsApplyingToolbar = () => {
8 const ideMessenger = useContext(IdeMessengerContext);
9
10 const jetbrains = window.location.protocol === "jb-api:";
11
12 return (
13 <Container>
14 <GeneratingIndicator text="Applying" />
15 <StopButton
16 className="text-description"
17 onClick={() => {
18 // Note that this will NOT stop generation but once apply is cancelled will show the Generating/cancel option
19 // Apply is prioritized because it can be more catastrophic
20 // Intentional to be more WYSIWYG for now
21 ideMessenger.post("cancelApply", undefined);
22 }}
23 >
24 {/* JetBrains overrides cmd+backspace, so we have to use another shortcut */}
25 {jetbrains ? getAltKeyLabel() : getMetaKeyLabel()} ⌫ Cancel
26 </StopButton>
27 </Container>
28 );
29};