-
Notifications
You must be signed in to change notification settings - Fork 8.2k
/
index.tsx
40 lines (36 loc) · 1.49 KB
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
import { EuiDelayRender, EuiSkeletonText } from '@elastic/eui';
import React from 'react';
import { SavedObjectsTaggingApi } from '@kbn/saved-objects-tagging-oss-plugin/public';
import type { ContentClient } from '@kbn/content-management-plugin/public';
import type { IUiSettingsClient } from '@kbn/core-ui-settings-browser';
import type { SavedObjectFinderProps } from './saved_object_finder';
const LazySavedObjectFinder = React.lazy(() => import('./saved_object_finder'));
const SavedObjectFinder = (props: SavedObjectFinderProps) => (
<React.Suspense
fallback={
<EuiDelayRender delay={300}>
<EuiSkeletonText />
</EuiDelayRender>
}
>
<LazySavedObjectFinder {...props} />
</React.Suspense>
);
export const getSavedObjectFinder = (
contentClient: ContentClient,
uiSettings: IUiSettingsClient,
savedObjectsTagging?: SavedObjectsTaggingApi
) => {
return (props: SavedObjectFinderProps) => (
<SavedObjectFinder {...props} services={{ savedObjectsTagging, contentClient, uiSettings }} />
);
};
export type { SavedObjectMetaData, SavedObjectFinderProps } from './saved_object_finder';
export { SavedObjectFinder };