import React from "react"; import Editor from "@monaco-editor/react"; import { FiFolder } from "react-icons/fi"; import { getLanguage } from "../helpers/fileTree"; interface CodeEditorProps { filePath: string; content: string; onChange: (content: string) => void; } export const CodeEditor: React.FC = ({ filePath, content, onChange, }) => { return (
{filePath ? ( onChange(value || "")} theme="vs-dark" options={{ minimap: { enabled: false }, fontSize: 14, fontFamily: "'Cascadia Code', 'Fira Code', monospace", tabSize: 4, wordWrap: "on", lineNumbers: "on", automaticLayout: true, renderWhitespace: "selection", smoothScrolling: true, }} /> ) : (
Welcome to Web VS Code
Right-click on a folder to create files
Or right-click anywhere in the explorer
)}
); };