import PlusIcon from "@Assets/Icons/plus.svg"; import Button, { EButtonVariant } from "@Front/Components/DesignSystem/Button"; import Typography, { ITypo, ITypoColor } from "@Front/Components/DesignSystem/Typography"; import UserFolder from "@Front/Components/DesignSystem/UserFolder"; import { IDashBoardFolder } from "@Front/Components/LayoutTemplates/DefaultNotaryDashboard"; import Module from "@Front/Config/Module"; import Link from "next/link"; import React from "react"; import classes from "./classes.module.scss"; type IProps = { folder: IDashBoardFolder; }; type IState = { openedCustomer: string; }; export default class ClientSection extends React.Component { public constructor(props: IProps) { super(props); this.state = { openedCustomer: "", }; this.changeUserFolder = this.changeUserFolder.bind(this); } public override render(): JSX.Element { const navigatePath = Module.getInstance() .get() .modules.pages.Folder.pages.AddClient.props.path.replace("[folderUid]", this.props.folder.uid ?? ""); return (
{this.doesFolderHaveCustomer() ? ( <>
{this.renderCustomerFolders()}
) : (
Aucun client n'est associƩ au dossier.
)}
); } private renderCustomerFolders() { const output = this.props.folder.customers?.map((customer) => { if (!customer) return null; return ( ); }); return output ?? null; } private changeUserFolder(uid: string) { this.setState({ openedCustomer: uid === this.state.openedCustomer ? "" : uid, }); } private doesFolderHaveCustomer(): boolean { if (!this.props.folder?.customers) return false; return this.props.folder?.customers!.length > 0; } }