import { useId, useMemo } from 'react'; import ReactQuill from 'react-quill'; import 'react-quill/dist/quill.snow.css'; type Props = { label: string; value: string; onChange: (nextHtml: string) => void; placeholder?: string; disabled?: boolean; help?: string; minHeightPx?: number; }; export function QuillField(props: Props) { const { label, value, onChange, placeholder, disabled, help, minHeightPx = 160 } = props; const id = useId(); const modules = useMemo(() => { return { toolbar: [ [{ header: [2, 3, false] }], ['bold', 'italic', 'underline'], [{ list: 'ordered' }, { list: 'bullet' }], ['link'], ['clean'], ], }; }, []); const formats = useMemo(() => { return ['header', 'bold', 'italic', 'underline', 'list', 'bullet', 'link']; }, []); return ( ); }