|
|
@@ -2,7 +2,7 @@ import { |
|
|
|
RecordTimesheetInput, |
|
|
|
RecordLeaveInput, |
|
|
|
} from "@/app/api/timesheets/actions"; |
|
|
|
import { shortDateFormatter } from "@/app/utils/formatUtil"; |
|
|
|
import { manhourFormatter, shortDateFormatter } from "@/app/utils/formatUtil"; |
|
|
|
import { Box, Stack, Typography } from "@mui/material"; |
|
|
|
import dayjs from "dayjs"; |
|
|
|
import React, { useMemo } from "react"; |
|
|
@@ -28,6 +28,7 @@ const PastEntryList: React.FC<Props> = ({ |
|
|
|
allProjects, |
|
|
|
}) => { |
|
|
|
const { |
|
|
|
t, |
|
|
|
i18n: { language }, |
|
|
|
} = useTranslation("home"); |
|
|
|
|
|
|
@@ -93,6 +94,16 @@ const PastEntryList: React.FC<Props> = ({ |
|
|
|
leaveTypeMap={leaveTypeMap} |
|
|
|
/> |
|
|
|
))} |
|
|
|
<Typography |
|
|
|
variant="overline" |
|
|
|
> |
|
|
|
{t("Total Work Hours")}: {manhourFormatter.format(timeEntries.map(entry => (entry.inputHours ?? 0) + (entry.otHours ?? 0)).reduce((acc, cur) => { return acc + cur }, 0))} |
|
|
|
</Typography> |
|
|
|
<Typography |
|
|
|
variant="overline" |
|
|
|
> |
|
|
|
{t("Total Leave Hours")}: {manhourFormatter.format(leaveEntries.map(entry => entry.inputHours).reduce((acc, cur) => { return acc + cur }, 0))} |
|
|
|
</Typography> |
|
|
|
</Box> |
|
|
|
</Stack> |
|
|
|
); |
|
|
|