File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ interface EditorProps
2424 setIsSearchDialogOpen : ( open : boolean ) => void ;
2525 toggleSidebar : ( ) => void ;
2626 createNewSnippet : ( ) => void ;
27+ loading ?: boolean ;
2728}
2829
2930const MonacoEditorComponent : React . FC < EditorProps > = ( {
@@ -38,6 +39,7 @@ const MonacoEditorComponent: React.FC<EditorProps> = ({
3839 toggleSidebar,
3940 createNewSnippet,
4041 snippets,
42+ loading,
4143} ) => {
4244 const editorRef = useRef < any > ( null ) ;
4345 const editorInstance = useRef < any > ( null ) ;
@@ -187,7 +189,9 @@ const MonacoEditorComponent: React.FC<EditorProps> = ({
187189 className = "flex-1 relative"
188190 style = { { height : isPreviewing ? "50%" : "100%" } }
189191 >
190- { ! hasSnippets ? (
192+ { loading ? (
193+ < Skeleton className = "flex flex-1 w-full h-full" />
194+ ) : ! hasSnippets ? (
191195 < div className = "flex flex-col items-center justify-center h-full" >
192196 < Sparkles className = "w-12 h-12 sm:w-24 sm:h-24 text-primary" />
193197 < span className = "text-sm sm:text-base text-center text-muted-foreground" >
Original file line number Diff line number Diff line change @@ -100,6 +100,7 @@ function Home() {
100100 isPreviewing = { isPreviewing }
101101 toggleSidebar = { toggleSidebar }
102102 createNewSnippet = { createNewSnippet }
103+ loading = { snippetHelpers . loading }
103104 />
104105 { isPreviewing && hasSnippets && (
105106 < div className = "h-1/2 overflow-auto w-full border-t" >
You can’t perform that action at this time.
0 commit comments