91 lines
3.0 KiB
JavaScript
91 lines
3.0 KiB
JavaScript
import Link from "next/link";
|
|
import { connect } from "react-redux";
|
|
import { useRouter } from "next/router";
|
|
import useTranslation from "next-translate/useTranslation";
|
|
import {
|
|
Field,
|
|
reduxForm,
|
|
formValueSelector,
|
|
handleSubmit,
|
|
reset,
|
|
} from "redux-form";
|
|
import {
|
|
RenderPickList,
|
|
RenderTextfield,
|
|
RenderRadioList,
|
|
RenderMultiline,
|
|
} from "./representationElements";
|
|
import { useDropzone } from "react-dropzone";
|
|
import RepDetails from "./representationDetails";
|
|
import { setRepresentationCapacity } from "../../../store/currentView/action";
|
|
|
|
let RepCapacitySelection = (props) => {
|
|
let { t } = useTranslation();
|
|
|
|
const router = useRouter();
|
|
const { locale } = router;
|
|
const {
|
|
formObj,
|
|
capacityOptionsArr,
|
|
currentType,
|
|
casesObj,
|
|
validate,
|
|
handleSubmit,
|
|
} = props;
|
|
const { acceptedFiles, getRootProps, getInputProps } = useDropzone();
|
|
const files = acceptedFiles.map((file) => (
|
|
<li key={file.path}>
|
|
{file.path} - {file.size} bytes
|
|
</li>
|
|
));
|
|
|
|
const required = (value) => (value ? undefined : "Required");
|
|
|
|
return (
|
|
<>
|
|
<RepDetails
|
|
formObj={formObj}
|
|
currentType={currentType}
|
|
casesObj={casesObj}
|
|
caseReference={props.props.caseReference}
|
|
searchResultsObj={props.props.searchResultsObj}
|
|
/>{" "}
|
|
<div id="rep-details" className="vo_hiddens">
|
|
<div className="govuk-grid-column-full">
|
|
<div className="govuk-grid-row">
|
|
<h2 className="govuk-heading-m ">
|
|
Your details - {props.firstValue}
|
|
</h2>
|
|
<Field
|
|
name="representationCapacity"
|
|
datafieldname="representationCapacity"
|
|
label="In what capacity do you wish to make representations on this case?"
|
|
options={capacityOptionsArr}
|
|
id="representationCapacity"
|
|
className="govuk-radios__input"
|
|
errorMsg={t("newappeal:select-an-option-label")}
|
|
component={RenderRadioList}
|
|
validate={[required]}
|
|
/>
|
|
</div>
|
|
</div>
|
|
<div className="govuk-grid-row">
|
|
<div className="govuk-grid-column-full">
|
|
<div className="govuk-button-group">
|
|
<button
|
|
type="submit"
|
|
className="govuk-button"
|
|
data-module="govuk-button"
|
|
>
|
|
Continue
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default RepCapacitySelection;
|