import dynamic from "next/dynamic"; import { useEffect, useState } from "react"; import { CODE_SEPARATOR, PYTHON_DEFAULT } from "../../utils/constant.js"; import styles from "../../styles/exos/ModelInput.module.scss"; import { parseClassName } from "../../utils/utils.js"; import { MdOutlineOpenInNew } from "react-icons/md"; import { RiErrorWarningFill } from "react-icons/ri"; let CustomEditor; if (typeof window !== "undefined") { CustomEditor = dynamic(() => import("./Editor.jsx")); } export default function ModelInput({ model, onChange, setModel, setFull, full, step, tempSpec, }) { const [python, setPython] = useState(""); useEffect(() => { if (full) { setPython(model.data ? model.data: PYTHON_DEFAULT); } return () => { setPython(""); }; }, [full]); return ( <> {!full && (