✨ add hours reminder document history
This commit is contained in:
parent
109a0f98dd
commit
e9b67d48c1
@ -55,7 +55,13 @@ export default function MuiTable(props: IProps) {
|
||||
className={classes["root"]}
|
||||
sx={{ maxHeight: "80vh", overflowY: "auto", overflowX: "hidden", backgroundColor: "var(--table-background-default)" }}>
|
||||
<Table aria-label="simple table" sx={{ border: "0" }}>
|
||||
<TableHead sx={{ position: "sticky", top: "0", borderBottom: "1px solid var(--table-header-border)" }}>
|
||||
<TableHead
|
||||
sx={{
|
||||
position: "sticky",
|
||||
top: "0",
|
||||
borderBottom: "1px solid var(--table-header-border)",
|
||||
backgroundColor: "var(--table-background-default)",
|
||||
}}>
|
||||
<TableRow>
|
||||
{props.header.map((column) => (
|
||||
<TableCell key={column.key} align={"left"} sx={{ border: 0, padding: "4px 8px" }}>
|
||||
|
@ -145,10 +145,13 @@ function buildRows(reminders: DocumentReminder[] | null): IRowProps[] {
|
||||
if (!reminders) return [];
|
||||
return reminders.map((reminder) => ({
|
||||
key: reminder.uid ?? "",
|
||||
remindedAt: new Date(reminder.reminder_date!).toLocaleDateString(),
|
||||
customer: `${reminder.document?.depositor?.contact?.first_name} ${reminder.document?.depositor?.contact?.last_name}`,
|
||||
remindedAt: { sx: { width: 220 }, content: formatDateWithHours(reminder.reminder_date) },
|
||||
customer: {
|
||||
sx: { width: 220 },
|
||||
content: `${reminder.document?.depositor?.contact?.first_name} ${reminder.document?.depositor?.contact?.last_name}`,
|
||||
},
|
||||
document_type: reminder.document?.document_type?.name,
|
||||
statut: getTag(reminder.document?.document_status as EDocumentStatus),
|
||||
statut: { sx: { width: 220 }, content: getTag(reminder.document?.document_status as EDocumentStatus) },
|
||||
}));
|
||||
}
|
||||
|
||||
@ -166,3 +169,14 @@ function getTag(status: EDocumentStatus) {
|
||||
return <Tag label={tradDocumentStatus[status]} color={ETagColor.INFO} variant={ETagVariant.SEMI_BOLD} />;
|
||||
}
|
||||
}
|
||||
|
||||
function formatDateWithHours(date: Date | null) {
|
||||
if (!date) return "-";
|
||||
return new Date(date).toLocaleDateString("fr-FR", {
|
||||
year: "numeric",
|
||||
month: "2-digit",
|
||||
day: "2-digit",
|
||||
hour: "2-digit",
|
||||
minute: "2-digit",
|
||||
});
|
||||
}
|
||||
|
@ -95,8 +95,7 @@ export default function EmailReminder(props: IProps) {
|
||||
</Link>
|
||||
<div className={classes["info"]}>
|
||||
<Typography typo={ETypo.TEXT_XS_REGULAR} color={ETypoColor.TEXT_SECONDARY}>
|
||||
Dernière relance:{" "}
|
||||
{reminders && remindersLength > 0 ? new Date(reminders[0]!.reminder_date!).toLocaleDateString() : "-"}
|
||||
Dernière relance: {reminders && remindersLength > 0 ? formatDateWithHours(reminders[0]!.reminder_date) : "-"}
|
||||
</Typography>
|
||||
<Typography typo={ETypo.TEXT_XS_REGULAR} color={ETypoColor.TEXT_SECONDARY}>
|
||||
Nombre de relance: {remindersLength}
|
||||
@ -107,3 +106,12 @@ export default function EmailReminder(props: IProps) {
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function formatDateWithHours(date: Date | null) {
|
||||
if (!date) return "-";
|
||||
return new Date(date).toLocaleDateString("fr-FR", {
|
||||
year: "numeric",
|
||||
month: "2-digit",
|
||||
day: "2-digit",
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user