// import React, { useState } from 'react';
// import {
// Button,
// Classes,
// FormGroup,
// InputGroup,
// Intent,
// TextArea,
// } from '@blueprintjs/core';
// import * as Yup from 'yup';
// import { FormattedMessage as T, useIntl } from 'react-intl';
// import { useFormik } from 'formik';
// import { compose } from 'utils';
// import Dialog from 'components/Dialog';
// import useAsync from 'hooks/async';
// import AppToaster from 'components/AppToaster';
// import withDialog from 'containers/Dialogs/withDialog';
// import DialogReduxConnect from 'components/DialogReduxConnect';
// // import ItemFormDialogConnect from 'connectors/ItemFormDialog.connect';
// function ItemFromDialog({
// name,
// payload,
// isOpen,
// submitItemCategory,
// fetchCategory,
// openDialog,
// closeDialog,
// }) {
// const [state, setState] = useState({});
// const { formatMessage } = useIntl();
// const ValidationSchema = Yup.object().shape({
// name: Yup.string().required().label(formatMessage({id:'category_name_'})),
// description: Yup.string().trim(),
// });
// const formik = useFormik({
// enableReinitialize: true,
// initialValues: {},
// validationSchema: ValidationSchema,
// onSubmit: (values) => {
// submitItemCategory({ values })
// .then((response) => {
// AppToaster.show({
// message: formatMessage({id:'the_category_has_been_successfully_created'}),
// });
// })
// .catch((error) => {
// alert(error.message);
// });
// },
// });
// const fetchHook = useAsync(async () => {
// await Promise.all([submitItemCategory]);
// });
// const handleClose = () => {
// closeDialog(name);
// };
// const onDialogOpening = () => {
// fetchHook.execute();
// openDialog(name);
// };
// const onDialogClosed = () => {
// // formik.resetForm();
// closeDialog(name);
// };
// return (
// :