import PlusIcon from "@Assets/Icons/plus.svg"; import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button"; import CheckBox from "@Front/Components/DesignSystem/CheckBox"; import Form, { IApiFormErrors } from "@Front/Components/DesignSystem/Form"; import InputField from "@Front/Components/DesignSystem/Form/Elements/InputField"; import Confirm from "@Front/Components/DesignSystem/Modal/Confirm"; import { IOption } from "@Front/Components/DesignSystem/Select"; import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography"; import BackArrow from "@Front/Components/Elements/BackArrow"; import DefaultNotaryDashboard from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard"; import React from "react"; import BasePage from "../../Base"; import classes from "./classes.module.scss"; type IProps = {}; type IState = { isCreateDocumentModalVisible: boolean; documentName: string; visibleDescription: string; }; export default class AskDocuments extends BasePage { private documentsType: IOption[] = [ { label: "Carte d'identité", value: "carte_identite" }, { label: "Diagnostic État Risques et Pollution", value: "diagnostic_erep" }, { label: "Justificatif de domicile", value: "justificatif_domicile" }, { label: "Diagnostic gaz", value: "diagnostic_gaz" }, { label: "Compromis de vente", value: "compromis_de_vente" }, { label: "Diagnostic DPE", value: "diagnostic_dpe" }, { label: "Diagnostic électrique", value: "diagnostic_electrique" }, { label: "Diagnostic plombs", value: "diagnostic_plombs" }, { label: "Diagnostic amiante", value: "diagnostic_amiante" }, { label: "Diagnostic termites", value: "diagnostic_termites" }, { label: "Diagnostic État des nuisances sonores aériennes", value: "diagnostic_ednsa" }, ]; public constructor(props: IProps) { super(props); this.state = { isCreateDocumentModalVisible: false, documentName: "", visibleDescription: "", }; this.onFormSubmit = this.onFormSubmit.bind(this); this.closeModal = this.closeModal.bind(this); this.openModal = this.openModal.bind(this); this.cancel = this.cancel.bind(this); this.onVisibleDescriptionChange = this.onVisibleDescriptionChange.bind(this); this.onDocumentNameChange = this.onDocumentNameChange.bind(this); this.addDocument = this.addDocument.bind(this); this.canAddDocument = this.canAddDocument.bind(this); } public override render(): JSX.Element { return ( {}}>
Demander des documents
{this.documentsType.map((documentType) => ( ))}
); } private canAddDocument() { if (this.state.documentName === "" || this.state.visibleDescription === "") { return false; } return true; } private addDocument() { this.setState({ isCreateDocumentModalVisible: false, documentName: "", visibleDescription: "", }); } private onVisibleDescriptionChange(e: React.ChangeEvent) { this.setState({ visibleDescription: e.target.value, }); } private onDocumentNameChange(e: React.ChangeEvent) { this.setState({ documentName: e.target.value, }); } private cancel() { this.setState({ visibleDescription: "", documentName: "", }); } private openModal() { this.setState({ isCreateDocumentModalVisible: true, visibleDescription: "", documentName: "", }); } private closeModal() { this.setState({ isCreateDocumentModalVisible: false, visibleDescription: "", documentName: "", }); } private onFormSubmit( e: React.FormEvent | null, values: { [key: string]: string; }, onApiErrors: (apiFormErrors: IApiFormErrors | null) => void, ) { console.log(values); } }