Merge branch 'dev' of github.com:smart-chain-fr/leCoffre-front into dev

This commit is contained in:
Max S 2024-07-23 12:05:48 +02:00
commit 9d6ef627dd
2 changed files with 11 additions and 3 deletions

View File

@ -11,16 +11,18 @@ import DeleteCustomerModal from "./DeleteCustomerModal";
import Link from "next/link"; import Link from "next/link";
import Module from "@Front/Config/Module"; import Module from "@Front/Config/Module";
import { useCallback } from "react"; import { useCallback } from "react";
import { Note } from "le-coffre-resources/dist/Customer";
type IProps = { type IProps = {
customer: ICustomer; customer: ICustomer;
anchorStatus: AnchorStatus; anchorStatus: AnchorStatus;
folderUid: string | undefined; folderUid: string | undefined;
customerNote: Note | null;
onDelete: (customerUid: string) => void; onDelete: (customerUid: string) => void;
}; };
export default function ClientBox(props: IProps) { export default function ClientBox(props: IProps) {
const { customer, anchorStatus, folderUid } = props; const { customer, anchorStatus, folderUid, customerNote } = props;
const { isOpen, open, close } = useOpenable(); const { isOpen, open, close } = useOpenable();
@ -68,7 +70,7 @@ export default function ClientBox(props: IProps) {
Note client Note client
</Typography> </Typography>
<Typography typo={ETypo.TEXT_LG_REGULAR} color={ETypoColor.COLOR_NEUTRAL_950}> <Typography typo={ETypo.TEXT_LG_REGULAR} color={ETypoColor.COLOR_NEUTRAL_950}>
{customer.notes?.[0]?.content ?? "_"} {customerNote?.content ?? "-"}
</Typography> </Typography>
</div> </div>

View File

@ -85,7 +85,13 @@ export default function ClientView(props: IProps) {
</div> </div>
<div className={classes["content"]}> <div className={classes["content"]}>
<div className={classes["client-box"]}> <div className={classes["client-box"]}>
<ClientBox customer={customer} anchorStatus={anchorStatus} folderUid={folder.uid} onDelete={handleClientDelete} /> <ClientBox
customer={customer}
anchorStatus={anchorStatus}
folderUid={folder.uid}
onDelete={handleClientDelete}
customerNote={folder.notes!.find((value) => value.customer?.uid === customer.uid) ?? null}
/>
{anchorStatus === AnchorStatus.NOT_ANCHORED && ( {anchorStatus === AnchorStatus.NOT_ANCHORED && (
<Link <Link
href={Module.getInstance() href={Module.getInstance()