| 1 | import { useAppDispatch } from "../../../../redux/hooks"; |
| 2 | import { cancelStream } from "../../../../redux/thunks/cancelStream"; |
| 3 | import { getAltKeyLabel, getMetaKeyLabel, isJetBrains } from "../../../../util"; |
| 4 | import { GeneratingIndicator } from "./GeneratingIndicator"; |
| 5 | |
| 6 | export function StreamingToolbar() { |
| 7 | const jetbrains = isJetBrains(); |
| 8 | const dispatch = useAppDispatch(); |
| 9 | |
| 10 | return ( |
| 11 | <div className="flex w-full items-center justify-between"> |
| 12 | <GeneratingIndicator /> |
| 13 | <div |
| 14 | onClick={() => void dispatch(cancelStream())} |
| 15 | className="text-2xs cursor-pointer px-1.5 py-0.5 hover:brightness-125" |
| 16 | > |
| 17 | <span className="text-description">Stop</span> |
| 18 | {/* JetBrains overrides cmd+backspace, so we have to use another shortcut */} |
| 19 | <span className="text-description-muted ml-1 opacity-75"> |
| 20 | {jetbrains ? getAltKeyLabel() : getMetaKeyLabel()}⌫ |
| 21 | </span> |
| 22 | </div> |
| 23 | </div> |
| 24 | ); |
| 25 | } |