import 'src/utils/highlight';
import dynamic from 'next/dynamic';
// @mui
import { alpha } from '@mui/material/styles';
import Skeleton from '@mui/material/Skeleton';
//
import { EditorProps } from './types';
import { StyledEditor } from './styles';
import Toolbar, { formats } from './toolbar';
const ReactQuill = dynamic(() => import('react-quill'), {
ssr: false,
loading: () => (
),
});
// ----------------------------------------------------------------------
export default function Editor({
id = 'minimal-quill',
error,
simple = false,
helperText,
sx,
...other
}: EditorProps) {
const modules = {
toolbar: {
container: `#${id}`,
},
history: {
delay: 500,
maxStack: 100,
userOnly: true,
},
syntax: true,
clipboard: {
matchVisual: false,
},
};
return (
<>
`solid 1px ${theme.palette.error.main}`,
'& .ql-editor': {
bgcolor: (theme) => alpha(theme.palette.error.main, 0.08),
},
}),
...sx,
}}
>
{helperText && helperText}
>
);
}