mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Obs AI Assistant] Enable syntax highlighting for ES|QL (#212669)
Closes https://github.com/elastic/kibana/issues/212384 ## Summary With https://github.com/elastic/eui/pull/8317, `EuiCodeBlock` supports syntax highlighting for ES|QL. This PR enables it for Obs AI Assistant ### Screenshots Before:  After:  ### Checklist - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
This commit is contained in:
parent
7590205f9a
commit
6d862d72a2
2 changed files with 4 additions and 1 deletions
|
@ -61,10 +61,12 @@ export function CodeBlock({ children }: { children: React.ReactNode }) {
|
|||
|
||||
export function EsqlCodeBlock({
|
||||
value,
|
||||
lang,
|
||||
actionsDisabled,
|
||||
onActionClick,
|
||||
}: {
|
||||
value: string;
|
||||
lang: string;
|
||||
actionsDisabled: boolean;
|
||||
onActionClick: ChatActionClickHandler;
|
||||
}) {
|
||||
|
@ -72,7 +74,7 @@ export function EsqlCodeBlock({
|
|||
<CodeBlockWrapper>
|
||||
<EuiFlexGroup direction="column" gutterSize="xs">
|
||||
<EuiFlexItem grow={false}>
|
||||
<EuiCodeBlock isCopyable fontSize="m">
|
||||
<EuiCodeBlock language={lang} isCopyable fontSize="m">
|
||||
{value}
|
||||
</EuiCodeBlock>
|
||||
</EuiFlexItem>
|
||||
|
|
|
@ -147,6 +147,7 @@ export function MessageText({ loading, content, onActionClick }: Props) {
|
|||
<>
|
||||
<EsqlCodeBlock
|
||||
value={props.value}
|
||||
lang={props.lang}
|
||||
actionsDisabled={loading}
|
||||
onActionClick={onActionClickRef.current}
|
||||
/>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue