import React from 'react'; import { FormControlledComponent } from '../../models/form-component'; import { AbstractFormItem, AbstractFormItemProps } from './abstract-form-item'; import { FieldValues } from 'react-hook-form/dist/types/fields'; import { FabTextEditor } from '../base/text-editor/fab-text-editor'; import { Controller, Path } from 'react-hook-form'; import { FieldPath } from 'react-hook-form/dist/types/path'; import { FieldPathValue, UnpackNestedValue } from 'react-hook-form/dist/types'; interface FormRichTextProps extends FormControlledComponent, AbstractFormItemProps { valueDefault?: string, limit?: number, paragraphTools?: boolean, video?: boolean, image?: boolean, } /** * THis component is a rich-text editor to use with react-hook-form. */ export const FormRichText = ({ id, label, tooltip, className, control, valueDefault, error, warning, rules, disabled, formState, limit, paragraphTools, video, image }: FormRichTextProps) => { return ( } control={control} defaultValue={valueDefault as UnpackNestedValue>>} render={({ field: { onChange, value } }) => } /> ); };