import Link from "next/link";
import { connect } from "react-redux";
import { useRouter } from "next/router";
import useTranslation from "next-translate/useTranslation";
import { Field, reduxForm, reset, change } from "redux-form";
import React, { useCallback, useEffect, useMemo, useState } from "react";
import {
RenderPickList,
RenderTextfield,
RenderRadioList,
RenderMultiline,
RenderRichMultiline,
RenderFileUpload,
FileUploadField,
RepresentationGuidanceText,
} from "./representationElements";
import {
getFormCollectionByID,
getThumbnailIconByExtension,
bytesToSize,
} from "../../utils";
import { useDropzone } from "react-dropzone";
// import {
// setRepresentationCapacity,
// setRepresentationSubmit,
// } from "../../../store/currentView/action";
const RepAppellant = (props) => {
let { t } = useTranslation();
const router = useRouter();
const { locale } = router;
const {
formObj,
appellantApplicantRepresentationArr,
setRepresentationCapacity,
setRepresentationSubmit,
currentView,
setRepFileName,
} = props;
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
setRepFileName(formObj.representationForm.values);
return (
<>
{typeof formObj.representationForm.values
.representationType == "undefined" &&
props.representationType != "Select..." ? (
<>
{t(
"myrepresentations:representation-from-an-appellant-heading"
)}
>
) : (
)}
{(typeof props.representationType != "undefined" ||
typeof formObj.representationForm.values.representationType !=
"undefined") && (
{t("myrepresentations:enter-comment-label")}
{" "}
)}
{typeof formObj.representationForm.values.representationType !=
"undefined" && (
)}
>
);
};
//const mapStateToProps = (state, props) => {};
const mapDispatchToProps = (dispatch) => ({
updateField: (form, field, newValue) =>
dispatch(change(form, field, newValue)),
});
export default connect(
null,
mapDispatchToProps
)(
reduxForm({
form: "representationForm",
enableReinitialize: true,
destroyOnUnmount: false,
})(RepAppellant)
);