import React, { forwardRef, KeyboardEventHandler, TextareaHTMLAttributes, useCallback } from 'react'; import { Textarea } from '~/components/input/Textarea'; import { useRandomPhrase } from '~/constants/phrases'; import { useCommentFormContext } from '~/hooks/comments/useCommentFormFormik'; interface IProps extends TextareaHTMLAttributes { isLoading?: boolean; } const LocalCommentFormTextarea = forwardRef(({ ...rest }, ref) => { const { values, handleChange, handleSubmit, isSubmitting } = useCommentFormContext(); const onKeyDown = useCallback>( ({ ctrlKey, key, metaKey }) => { if ((ctrlKey || metaKey) && key === 'Enter') handleSubmit(undefined); }, [handleSubmit] ); const placeholder = useRandomPhrase('SIMPLE'); return (