CommandExecutionError.tsx 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { useCallback } from "react"
  2. import { useTranslation, Trans } from "react-i18next"
  3. import { VSCodeLink } from "@vscode/webview-ui-toolkit/react"
  4. import { buildDocLink } from "../../utils/docLinks"
  5. export const CommandExecutionError = () => {
  6. const { t } = useTranslation()
  7. const onClick = useCallback((e: React.MouseEvent<HTMLAnchorElement>) => {
  8. e.preventDefault()
  9. window.postMessage({ type: "action", action: "settingsButtonClicked", values: { section: "terminal" } }, "*")
  10. }, [])
  11. return (
  12. <div className="text-sm bg-vscode-editor-background border border-vscode-border rounded-lg p-3 ml-6">
  13. <div className="flex flex-col gap-2">
  14. <div className="flex items-center">
  15. <i className="codicon codicon-warning mr-1 text-vscode-editorWarning-foreground" />
  16. <span className="text-vscode-editorWarning-foreground font-semibold">
  17. {t("chat:shellIntegration.title")}
  18. </span>
  19. </div>
  20. <div>
  21. <Trans
  22. i18nKey="chat:shellIntegration.description"
  23. components={{
  24. settingsLink: <VSCodeLink href="#" onClick={onClick} className="inline" />,
  25. }}
  26. />
  27. </div>
  28. <a
  29. href={buildDocLink("troubleshooting/shell-integration/", "error_tooltip")}
  30. className="underline"
  31. style={{ color: "inherit" }}>
  32. {t("chat:shellIntegration.troubleshooting")}
  33. </a>
  34. </div>
  35. </div>
  36. )
  37. }