import { useEffect, useRef } from 'react';
import { BaseEditor } from '../../editor/editor';

export const FileEditor = () => {
  const containerRef = useRef<HTMLDivElement>(null);
  useEffect(() => {
    const editor = new BaseEditor();
    if (containerRef.current) {
      editor.createEditor(containerRef.current);
    }
    return () => {
      editor.destroyEditor();
    };
  }, []);

  return <div ref={containerRef} className='w-full h-full'></div>;
};
