mirror of https://github.com/buster-so/buster.git
Add some text for loading state
This commit is contained in:
parent
596b9edc38
commit
ed9a09e051
|
@ -4,14 +4,13 @@
|
|||
import type { EditorProps, OnMount } from '@monaco-editor/react';
|
||||
import { ClientOnly } from '@tanstack/react-router';
|
||||
import type React from 'react';
|
||||
import { forwardRef, lazy, Suspense, useCallback, useEffect, useMemo } from 'react';
|
||||
import { forwardRef, lazy, Suspense, useCallback, useMemo } from 'react';
|
||||
import { useMount } from '@/hooks/useMount';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { isServer } from '@/lib/window';
|
||||
import { LoadingCodeEditor } from './LoadingCodeEditor';
|
||||
import { setupMonacoWebWorker } from './setupMonacoWebWorker';
|
||||
import { configureMonacoToUseYaml } from './yamlHelper';
|
||||
|
||||
const isServer = typeof window === 'undefined';
|
||||
let hasSetupMonacoWebWorker = false;
|
||||
|
||||
//https://github.com/brijeshb42/monaco-ace-tokenizer
|
||||
|
@ -192,6 +191,7 @@ export const AppCodeEditor = forwardRef<AppCodeEditorHandle, AppCodeEditorProps>
|
|||
onMount={onMountCodeEditor}
|
||||
onChange={onChangeCodeEditor}
|
||||
options={memoizedMonacoEditorOptions}
|
||||
loading={<LoadingCodeEditor />}
|
||||
/>
|
||||
</Suspense>
|
||||
</ClientOnly>
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
import { useMount } from '@/hooks/useMount';
|
||||
import { CircleSpinnerLoaderContainer } from '../../loaders/CircleSpinnerLoaderContainer';
|
||||
import { Text } from '../../typography/Text';
|
||||
|
||||
export const LoadingCodeEditor = () => {
|
||||
export const LoadingCodeEditor = ({ text = 'Loading code editor...' }) => {
|
||||
return (
|
||||
<div className="animate-in fade-in-0 duration-300">
|
||||
<CircleSpinnerLoaderContainer className="animate-in fade-in-0 duration-300" />
|
||||
<div className="animate-in h-full flex flex-col items-center justify-center duration-300">
|
||||
<div className="flex flex-col items-center justify-center space-y-4">
|
||||
<Text>{text}</Text>
|
||||
<CircleSpinnerLoaderContainer />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue