| 1 | import { MinusCircleIcon, XMarkIcon } from "@heroicons/react/24/outline"; |
| 2 | import { ContinueError } from "core"; |
| 3 | import styled from "styled-components"; |
| 4 | import { defaultBorderRadius, vscBackground } from ".."; |
| 5 | import HeaderButtonWithToolTip from "./HeaderButtonWithToolTip"; |
| 6 | |
| 7 | const Div = styled.div` |
| 8 | padding: 8px; |
| 9 | background-color: #ff000011; |
| 10 | border-radius: ${defaultBorderRadius}; |
| 11 | border: 1px solid #cc0000; |
| 12 | margin: 8px; |
| 13 | `; |
| 14 | |
| 15 | interface ErrorStepContainerProps { |
| 16 | error: ContinueError; |
| 17 | onClose: () => void; |
| 18 | onDelete: () => void; |
| 19 | } |
| 20 | |
| 21 | function ErrorStepContainer(props: ErrorStepContainerProps) { |
| 22 | return ( |
| 23 | <div style={{ backgroundColor: vscBackground, position: "relative" }}> |
| 24 | <div |
| 25 | style={{ |
| 26 | position: "absolute", |
| 27 | right: "12px", |
| 28 | top: "12px", |
| 29 | display: "flex", |
| 30 | }} |
| 31 | > |
| 32 | <HeaderButtonWithToolTip |
| 33 | text="Collapse" |
| 34 | onClick={() => props.onClose()} |
| 35 | > |
| 36 | <MinusCircleIcon width="1.3em" height="1.3em" /> |
| 37 | </HeaderButtonWithToolTip> |
| 38 | <HeaderButtonWithToolTip text="Delete" onClick={() => props.onDelete()}> |
| 39 | <XMarkIcon width="1.3em" height="1.3em" /> |
| 40 | </HeaderButtonWithToolTip> |
| 41 | </div> |
| 42 | <Div> |
| 43 | <pre style={{ whiteSpace: "pre-wrap", wordWrap: "break-word" }}> |
| 44 | {props.error.message as string} |
| 45 | </pre> |
| 46 | </Div> |
| 47 | </div> |
| 48 | ); |
| 49 | } |
| 50 | |
| 51 | export default ErrorStepContainer; |