| 1 | import { useAppDispatch } from "../../../../redux/hooks"; |
| 2 | import { cancelStream } from "../../../../redux/thunks"; |
| 3 | import { getAltKeyLabel, getMetaKeyLabel, isJetBrains } from "../../../../util"; |
| 4 | import { Container, StopButton } from "./components"; |
| 5 | import { GeneratingIndicator } from "./GeneratingIndicator"; |
| 6 | |
| 7 | export function StreamingToolbar() { |
| 8 | const dispatch = useAppDispatch(); |
| 9 | const jetbrains = isJetBrains(); |
| 10 | |
| 11 | return ( |
| 12 | <Container> |
| 13 | <GeneratingIndicator /> |
| 14 | <StopButton |
| 15 | className="text-description" |
| 16 | onClick={() => { |
| 17 | void dispatch(cancelStream()); |
| 18 | }} |
| 19 | > |
| 20 | {jetbrains ? getAltKeyLabel() : getMetaKeyLabel()} ⌫ Cancel |
| 21 | </StopButton> |
| 22 | </Container> |
| 23 | ); |
| 24 | } |