import { CodeBracketSquareIcon } from '@heroicons/react/24/solid' import MonacoEditor from '@monaco-editor/react' import type { Dispatch, SetStateAction } from 'react' import { Controller } from 'react-hook-form' import { useRemixFormContext } from 'remix-hook-form' import { EditorButton } from './editor-button' type TProperties = { name: string disabled?: boolean setIsPlainHTML: Dispatch> } // const MonacoEditor = dynamic(() => import('@monaco-editor/react'), { // ssr: false, // }) export const EditorTextArea = (properties: TProperties) => { const { setIsPlainHTML, name, disabled = false } = properties const { control } = useRemixFormContext() return ( <>
setIsPlainHTML(false)} title="Switch to Rich Text" >
( { field.onChange(newValue) }} value={field.value} options={{ readOnly: disabled, wordWrap: 'on', }} className="mb-1 h-96 max-w-none overflow-y-auto rounded-[0_0_5px_5px] border border-[#D2D2D2] p-1" /> )} /> ) }