[ML] Sets max height and preserve whitespace in categorization wizard examples (#103637)

* [ML] Sets max height and preserve whitespace in categorization wizard examples

* [ML] Edit following review
This commit is contained in:
Pete Harverson 2021-06-29 14:36:41 +01:00 committed by GitHub
parent 85709925cc
commit 0f79872219
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,7 +7,7 @@
import React, { FC } from 'react';
import { i18n } from '@kbn/i18n';
import { EuiBasicTable, EuiText } from '@elastic/eui';
import { EuiBasicTable, EuiCodeBlock } from '@elastic/eui';
import { CategoryFieldExample } from '../../../../../../../../../common/types/categories';
interface Props {
@ -31,9 +31,14 @@ export const FieldExamples: FC<Props> = ({ fieldExamples }) => {
}
),
render: (example: any) => (
<EuiText size="s">
<code>{example}</code>
</EuiText>
<EuiCodeBlock
fontSize="s"
paddingSize="none"
transparentBackground
style={{ maxHeight: '200px' }} // Don't use overflowHeight as don't want to show the fullscreen button
>
{example}
</EuiCodeBlock>
),
},
];