'use client' import { useState, useEffect, useRef, useImperativeHandle, forwardRef } from 'react' import dynamic from 'next/dynamic' import { motion } from 'framer-motion' import { Play, Send, Loader2 } from 'lucide-react' import toast from 'react-hot-toast' import type { editor } from 'monaco-editor' import CodeMirror from '@uiw/react-codemirror' import { python } from '@codemirror/lang-python' import { java } from '@codemirror/lang-java' import { oneDark } from '@codemirror/theme-one-dark' import { autocompletion } from '@codemirror/autocomplete' import { EditorView } from '@codemirror/view' import { HighlightStyle, syntaxHighlighting } from '@codemirror/language' import { tags as t } from '@lezer/highlight' const MonacoEditor = dynamic(() => import('@monaco-editor/react'), { ssr: false, loading: () => (