Merge branch 'upgrade_Expense' of https://git.marcoaiot.com/admin/marco.pms.web into Issues_Expense_2W

This commit is contained in:
Kartik Sharma 2025-11-07 16:56:19 +05:30
commit 9668c1f41c

View File

@ -5,7 +5,7 @@ import Timeline from "../common/TimeLine";
import moment from "moment";
import { getColorNameFromHex } from "../../utils/appUtils";
const ExpenseStatusLogs = ({ data }) => {
const [visibleCount, setVisibleCount] = useState(4);
const sortedLogs = useMemo(() => {
if (!data?.expenseLogs) return [];
@ -14,13 +14,8 @@ const ExpenseStatusLogs = ({ data }) => {
);
}, [data?.expenseLogs]);
const logsToShow = useMemo(
() => sortedLogs.slice(0, visibleCount),
[sortedLogs, visibleCount]
);
console.log(logsToShow);
const timelineData = useMemo(() => {
return logsToShow.map((log, index) => ({
return sortedLogs.map((log, index) => ({
id: index + 1,
title: log.action || "Status Updated",
description: log.comment || "",
@ -37,7 +32,7 @@ const ExpenseStatusLogs = ({ data }) => {
]
: [],
}));
}, [logsToShow]);
}, [sortedLogs]);
const handleShowMore = () => {
setVisibleCount((prev) => prev + 4);