diff --git a/packages/console/src/components/CodeEditor/index.module.scss b/packages/console/src/components/CodeEditor/index.module.scss index d4579a524..181cfd2c5 100644 --- a/packages/console/src/components/CodeEditor/index.module.scss +++ b/packages/console/src/components/CodeEditor/index.module.scss @@ -57,3 +57,9 @@ } } } + +.errorMessage { + font: var(--font-body-medium); + color: var(--color-error); + margin-top: _.unit(1); +} diff --git a/packages/console/src/components/CodeEditor/index.tsx b/packages/console/src/components/CodeEditor/index.tsx index 8f40238ca..86e27ef76 100644 --- a/packages/console/src/components/CodeEditor/index.tsx +++ b/packages/console/src/components/CodeEditor/index.tsx @@ -14,6 +14,8 @@ type Props = { value?: string; onChange?: (value: string) => void; tabSize?: number; + hasError?: boolean; + errorMessage?: string; }; const CodeEditor = ({ @@ -23,6 +25,8 @@ const CodeEditor = ({ value = '', onChange, tabSize = 2, + hasError, + errorMessage, }: Props) => { const textareaRef = useRef(null); @@ -49,49 +53,52 @@ const CodeEditor = ({ }; return ( -
- -
- {/* SyntaxHighlighter is a readonly component, so a transparent