import PenIcon from "@Assets/Icons/pen.svg"; import { IDashBoardFolder } from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard"; import Module from "@Front/Config/Module"; import { Customer } from "le-coffre-resources/dist/Notary"; import Image from "next/image"; import Link from "next/link"; import React from "react"; import Typography, { ITypo } from "../../Typography"; import WarningBadge from "../../WarningBadge"; import classes from "./classes.module.scss"; import { EDocumentStatus } from "le-coffre-resources/dist/Customer/Document"; type IProps = { customer: Customer; folder: IDashBoardFolder; isArchived?: boolean; }; type IState = {}; export default class UserFolderHeader extends React.Component { static defaultProps = { isArchived: false, }; public override render(): JSX.Element | null { const redirectPath = Module.getInstance() .get() .modules.pages.Folder.pages.EditClient.props.path.replace("[folderUid]", this.props.folder.uid ?? "") .replace("[customerUid]", this.props.customer.uid ?? ""); if (!this.props.customer.contact) return null; return (
Nom {this.props.customer.contact.last_name}
Prénom {this.props.customer.contact.first_name}
Numéro de téléphone {this.formatPhoneNumber(this.props.customer.contact.cell_phone_number) ?? this.formatPhoneNumber(this.props.customer.contact.phone_number?.toString() ?? "")}
E-mail {this.props.customer.contact.email}
{!this.props.isArchived && (
{this.hasPendingFiles() && } edit
)}
); } private hasPendingFiles() { const documents = this.props.folder.documents?.filter((document) => document.depositor?.contact?.uid === this.props.customer.contact?.uid) ?? []; const notAskedDocuments = documents.filter((document) => document.document_status === EDocumentStatus.DEPOSITED) ?? []; return notAskedDocuments.length > 0; } private formatPhoneNumber(phoneNumber: string): string { if (!phoneNumber) return ""; const output = phoneNumber.split("").map((char, index) => { if (index % 2) return char + " "; return char; }); return output.join(""); } private onEditClick(): void {} }