39 lines
889 B
TypeScript
39 lines
889 B
TypeScript
import { FC } from 'react'
|
|
import ReactQuill from 'react-quill-new'
|
|
|
|
interface EmailEditorProps {
|
|
value: string
|
|
onChange: (value: string) => void
|
|
placeholder?: string
|
|
}
|
|
|
|
const EmailEditor: FC<EmailEditorProps> = ({
|
|
value,
|
|
onChange,
|
|
placeholder = ''
|
|
}) => {
|
|
const modules = {
|
|
toolbar: [
|
|
[{ header: '1' }, { header: '2' }, { font: [] }],
|
|
[{ list: 'ordered' }, { list: 'bullet' }],
|
|
['bold', 'italic', 'underline'],
|
|
['link', 'image'],
|
|
[{ align: [] }],
|
|
['clean']
|
|
]
|
|
}
|
|
|
|
return (
|
|
<ReactQuill
|
|
modules={modules}
|
|
theme="snow"
|
|
value={value}
|
|
onChange={onChange}
|
|
placeholder={placeholder}
|
|
style={{ minHeight: '120px' }}
|
|
className='text-sm'
|
|
/>
|
|
)
|
|
}
|
|
|
|
export default EmailEditor
|