import React from "react"; import Editor from "@monaco-editor/react"; import { DemoFile } from "@/types/demo"; import { useTheme } from "next-themes"; interface CodeEditorProps { file?: DemoFile; onFileChange?: (fileName: string, content: string) => void; } export function CodeEditor({ file, onFileChange }: CodeEditorProps) { const handleEditorChange = (value: string | undefined) => { if (value && onFileChange) { onFileChange(file!.name, value); } }; const theme = useTheme(); return file ? (