✨ Client note showing
This commit is contained in:
parent
26d217b6ae
commit
c0025e6116
@ -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>
|
||||||
|
|
||||||
|
@ -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()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user