diff --git a/src/components/Posts/NewCommentForm/NewCommentForm.tsx b/src/components/Posts/NewCommentForm/NewCommentForm.tsx index 203fda94f..73d982228 100644 --- a/src/components/Posts/NewCommentForm/NewCommentForm.tsx +++ b/src/components/Posts/NewCommentForm/NewCommentForm.tsx @@ -8,21 +8,8 @@ interface NewCommentFormProps { export const NewCommentForm: React.FC = ({ handleAddComment, }) => { - const { - name, - nameError, - email, - emailError, - body, - bodyError, - isLoading, - - handleChangeName, - handleChangeEmail, - handleChangeBody, - reset, - handleSubmit, - } = useCommentForm(handleAddComment); + const { isLoading, state, reset, handleSubmit, handleChange } = + useCommentForm(handleAddComment); return (
@@ -35,18 +22,18 @@ export const NewCommentForm: React.FC = ({ - {nameError && ( + {state.name.error && ( = ({ )} - {nameError && ( + {state.name.error && (

- {nameError} + {state.name.error}

)} @@ -72,18 +59,18 @@ export const NewCommentForm: React.FC = ({ - {emailError && ( + {state.email.error && ( = ({ )} - {emailError && ( + {state.email.error && (

- {emailError} + {state.email.error}

)} @@ -109,16 +96,16 @@ export const NewCommentForm: React.FC = ({