diff --git a/public/assets/vendor/css/core.css b/public/assets/vendor/css/core.css index a9930ceb..85124986 100644 --- a/public/assets/vendor/css/core.css +++ b/public/assets/vendor/css/core.css @@ -20473,7 +20473,10 @@ li:not(:first-child) .dropdown-item, word-wrap: break-word !important; word-break: break-word !important; } - +/* text-size */ +.text-tiny{ + font-size: 13px; +} /* rtl:end:remove */ .text-primary { --bs-text-opacity: 1; diff --git a/src/components/Expenses/ExpenseStatusLogs.jsx b/src/components/Expenses/ExpenseStatusLogs.jsx new file mode 100644 index 00000000..6688be99 --- /dev/null +++ b/src/components/Expenses/ExpenseStatusLogs.jsx @@ -0,0 +1,63 @@ +import { useState } from "react"; +import Avatar from "../common/Avatar"; + +const ExpenseStatusLogs = ({ data }) => { + const [visibleCount, setVisibleCount] = useState(4); + + const logsToShow = data?.expenseLogs?.slice(0, visibleCount) || []; + + const handleShowMore = () => { + setVisibleCount((prev) => prev + 4); + }; + + return ( + <> +
+ {logsToShow.map((log, index) => ( +
+ + +
+
+
+
+
+ {`${log.updatedBy.firstName} ${log.updatedBy.lastName}`} + + {log.action} + + {log?.updateAt ?? "14-Aug-2025"} +
+
+
+ {log.comment} +
+
+
+
+
+ ))} +
+ + {data?.expenseLogs?.length > visibleCount && ( +
+ +
+ )} + + ); +}; + +export default ExpenseStatusLogs; diff --git a/src/components/Expenses/ViewExpense.jsx b/src/components/Expenses/ViewExpense.jsx index 3f10f3fd..978b85c3 100644 --- a/src/components/Expenses/ViewExpense.jsx +++ b/src/components/Expenses/ViewExpense.jsx @@ -27,6 +27,7 @@ import { useEmployeeRoles, useEmployeesName } from "../../hooks/useEmployees"; import EmployeeSearchInput from "../common/EmployeeSearchInput"; import { z } from "zod"; import moment from "moment"; +import ExpenseStatusLogs from "./ExpenseStatusLogs"; const ViewExpense = ({ ExpenseId }) => { const { data, isLoading, isError, error } = useExpense(ExpenseId); @@ -111,7 +112,12 @@ const ViewExpense = ({ ExpenseId }) => {
Expense Details

- +
+ {/* */} +
{data?.description}
+
{/* Row 1 */}
@@ -270,7 +276,7 @@ const ViewExpense = ({ ExpenseId }) => {
)} - {data.reviewedBy && ( + {/* {data.reviewedBy && (
- )} + )} */} {data.expensesReimburse && (
-
+
{data.expensesReimburse.reimburseTransactionId || "N/A"}
-
+
@@ -364,7 +370,7 @@ const ViewExpense = ({ ExpenseId }) => { {data.expensesReimburse && ( <> -
+
@@ -380,20 +386,15 @@ const ViewExpense = ({ ExpenseId }) => {
)} - -
- {" "} - {data.expensesReimburse.reimburseNote} -
)} -
+ {/*
{data?.description}
-
+
*/}
@@ -488,7 +489,7 @@ const ViewExpense = ({ ExpenseId }) => { )}
- + {
)} + + + + + ); }; diff --git a/src/pages/ErrorPage.jsx b/src/pages/ErrorPage.jsx index 79db5408..2666e71e 100644 --- a/src/pages/ErrorPage.jsx +++ b/src/pages/ErrorPage.jsx @@ -1,24 +1,56 @@ import React from 'react'; import { useRouteError, isRouteErrorResponse } from 'react-router-dom'; -const ErrorPage =() =>{ +const ErrorPage = () => { const error = useRouteError(); - console.error(error); + console.error('Route Error:', error); if (isRouteErrorResponse(error)) { + const { status, statusText, data } = error; + return ( -
-

{error.status}

-

{error.statusText}

+
+

Oops! Something went wrong.

+

We couldn’t load the page you requested.

+ +
+ +

Error Details

+
    +
  • Status: {status}
  • +
  • Status Text: {statusText}
  • + {data &&
  • Message: {typeof data === 'string' ? data : JSON.stringify(data)}
  • } +
); } + const { + message = 'An unexpected error occurred.', + name, + stack, + } = error || {}; + return ( -
-

Something went wrong.

-

{error?.message || 'Unknown error occurred'}

+
+

Something went wrong.

+

Sorry, we couldn’t complete your request.

+ + {message && ( +
+ {name ? `${name}: ` : ''} + {message} +
+ )} + + {stack && ( +
+ Developer Details (Stack Trace) +
{stack}
+
+ )}
); -} -export default ErrorPage \ No newline at end of file +}; + +export default ErrorPage;