Files
Josh Hunt 0ca1febb77 FolderPicker: Make lazy in prep for exposing publicly (#100118)
* Make lazy NestedFolderPicker

* Change permission prop to use string union instead of enum

* reword comment
2025-02-05 17:21:32 +02:00

17 lines
555 B
TypeScript

import { Suspense, lazy } from 'react';
import { FolderPickerSkeleton } from './Skeleton';
const SuspendingNestedFolderPicker = lazy(() =>
import('./NestedFolderPicker').then((module) => ({ default: module.NestedFolderPicker }))
);
// Lazily load folder picker, is what is exposed to plugins through @grafana/runtime
export const LazyFolderPicker = (props: Parameters<typeof SuspendingNestedFolderPicker>[0]) => {
return (
<Suspense fallback={<FolderPickerSkeleton />}>
<SuspendingNestedFolderPicker {...props} />
</Suspense>
);
};