Properly updateExpense time line
This commit is contained in:
parent
82f173c0ed
commit
06e8046dde
@ -12,15 +12,14 @@ const ExpenseStatusLogs = ({ data }) => {
|
||||
return [...data.expenseLogs].sort(
|
||||
(a, b) => new Date(b.updateAt) - new Date(a.updateAt)
|
||||
);
|
||||
}, [data?.updateLogs]);
|
||||
}, [data?.expenseLogs]);
|
||||
|
||||
const logsToShow = useMemo(
|
||||
() => sortedLogs.slice(0, visibleCount),
|
||||
[sortedLogs, visibleCount]
|
||||
);
|
||||
console.log(logsToShow)
|
||||
console.log(logsToShow);
|
||||
const timelineData = useMemo(() => {
|
||||
|
||||
return logsToShow.map((log, index) => ({
|
||||
id: index + 1,
|
||||
title: log.action || "Status Updated",
|
||||
@ -46,8 +45,6 @@ console.log(logsToShow)
|
||||
|
||||
return (
|
||||
<div className="page-min-h overflow-auto py-1">
|
||||
|
||||
|
||||
<Timeline items={timelineData} />
|
||||
</div>
|
||||
);
|
||||
|
||||
@ -152,9 +152,9 @@ const ViewExpense = ({ ExpenseId }) => {
|
||||
className="form-label me-2 mb-0 fw-semibold text-start"
|
||||
style={{ minWidth: "130px" }}
|
||||
>
|
||||
Expense Type :
|
||||
Expense Category :
|
||||
</label>
|
||||
<div className="text-muted">{data?.expensesType?.name}</div>
|
||||
<div className="text-muted">{data?.expenseCategory?.name}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user