mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[data views] Improve preview pane (#126013)
* fix preview pane * fix preview pane * one less span tag Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
f19a3ac68e
commit
7dbe341c78
1 changed files with 5 additions and 2 deletions
|
@ -16,6 +16,7 @@ import React, {
|
|||
useRef,
|
||||
FunctionComponent,
|
||||
} from 'react';
|
||||
import { renderToString } from 'react-dom/server';
|
||||
import useDebounce from 'react-use/lib/useDebounce';
|
||||
import { i18n } from '@kbn/i18n';
|
||||
import { get } from 'lodash';
|
||||
|
@ -45,8 +46,10 @@ const defaultParams: Params = {
|
|||
format: null,
|
||||
};
|
||||
|
||||
export const defaultValueFormatter = (value: unknown) =>
|
||||
`<span>${typeof value === 'object' ? JSON.stringify(value) : value ?? '-'}</span>`;
|
||||
export const defaultValueFormatter = (value: unknown) => {
|
||||
const content = typeof value === 'object' ? JSON.stringify(value) : String(value) ?? '-';
|
||||
return renderToString(<>{content}</>);
|
||||
};
|
||||
|
||||
export const FieldPreviewProvider: FunctionComponent = ({ children }) => {
|
||||
const previewCount = useRef(0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue