diff --git a/src/pages/employee/EmployeeList.jsx b/src/pages/employee/EmployeeList.jsx
index ad54ce20..be586d18 100644
--- a/src/pages/employee/EmployeeList.jsx
+++ b/src/pages/employee/EmployeeList.jsx
@@ -176,12 +176,10 @@ const EmployeeList = () => {
useEffect(() => {
if (!loading && Array.isArray(employees)) {
const sorted = [...employees].sort((a, b) => {
- const nameA = `${a.firstName || ""}${a.middleName || ""}${
- a.lastName || ""
- }`.toLowerCase();
- const nameB = `${b.firstName || ""}${b.middleName || ""}${
- b.lastName || ""
- }`.toLowerCase();
+ const nameA = `${a.firstName || ""}${a.middleName || ""}${a.lastName || ""
+ }`.toLowerCase();
+ const nameB = `${b.firstName || ""}${b.middleName || ""}${b.lastName || ""
+ }`.toLowerCase();
return nameA?.localeCompare(nameB);
});
@@ -503,9 +501,8 @@ const EmployeeList = () => {
Status
{
)}
{/* Conditional messages for no data or no search results */}
{!loading &&
- displayData?.length === 0 &&
- searchText &&
- !showAllEmployees ? (
+ displayData?.length === 0 &&
+ searchText &&
+ !showAllEmployees ? (
|
|
@@ -537,8 +534,8 @@ const EmployeeList = () => {
|
) : null}
{!loading &&
- displayData?.length === 0 &&
- (!searchText || showAllEmployees) ? (
+ displayData?.length === 0 &&
+ (!searchText || showAllEmployees) ? (
| {
+ {/* View always visible */}
-
- {!item.isSystem && (
+
+ {/* If ACTIVE employee */}
+ {item.isActive && (
<>
+
+ {/* Suspend only when active */}
+
+
+
>
)}
+
+ {/* If INACTIVE employee AND inactive toggle is ON */}
+ {!item.isActive && showInactive && (
+
+ )}
|
@@ -687,9 +692,8 @@ const EmployeeList = () => {