mirror of
				https://litchi.icu/ngc2207/judge.git
				synced 2025-11-04 15:07:55 +00:00 
			
		
		
		
	refactor(playground): remove loading skeleton from editor panel for cleaner code
This commit is contained in:
		
							parent
							
								
									fde0ea77e9
								
							
						
					
					
						commit
						1628f1ad4b
					
				@ -1,12 +1,10 @@
 | 
			
		||||
"use client";
 | 
			
		||||
 | 
			
		||||
import { useEffect, useState } from "react";
 | 
			
		||||
import { useEffect } from "react";
 | 
			
		||||
import { useEditorStore } from "@/store/useEditorStore";
 | 
			
		||||
import { Skeleton } from "@/components/ui/skeleton";
 | 
			
		||||
 | 
			
		||||
export default function EditorPanel() {
 | 
			
		||||
  const { setLanguage, setCode } = useEditorStore();
 | 
			
		||||
  const [loading, setLoading] = useState(true);
 | 
			
		||||
 | 
			
		||||
  useEffect(() => {
 | 
			
		||||
    const handleMessage = (event: MessageEvent) => {
 | 
			
		||||
@ -25,34 +23,5 @@ export default function EditorPanel() {
 | 
			
		||||
    };
 | 
			
		||||
  }, [setLanguage, setCode]);
 | 
			
		||||
 | 
			
		||||
  const handleLoad = () => {
 | 
			
		||||
    setLoading(false);
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  return (
 | 
			
		||||
    <div className="relative w-full h-full">
 | 
			
		||||
      {/* {loading && (
 | 
			
		||||
        <div className="absolute inset-0 flex flex-col bg-[#282c34]">
 | 
			
		||||
          <div className="flex-initial p-4 border-b border-[#3e4452] flex justify-between items-center">
 | 
			
		||||
            <div className="space-x-2 flex items-center">
 | 
			
		||||
              <Skeleton className="h-8 w-24 rounded-md" />
 | 
			
		||||
              <Skeleton className="h-8 w-24 rounded-md" />
 | 
			
		||||
            </div>
 | 
			
		||||
            <div className="space-x-2 flex items-center">
 | 
			
		||||
              <Skeleton className="h-8 w-24 rounded-md" />
 | 
			
		||||
              <Skeleton className="h-8 w-24 rounded-md" />
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
          <div className="flex-grow p-4">
 | 
			
		||||
            <Skeleton className="w-full h-full rounded-md" />
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      )} */}
 | 
			
		||||
      <iframe
 | 
			
		||||
        src="https://editor.litchi.icu"
 | 
			
		||||
        className="w-full h-full"
 | 
			
		||||
        onLoad={handleLoad}
 | 
			
		||||
      />
 | 
			
		||||
    </div>
 | 
			
		||||
  );
 | 
			
		||||
  return <iframe src="https://editor.litchi.icu" className="w-full h-full" />;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user