diff --git a/src/components/Project/MapUsers.jsx b/src/components/Project/MapUsers.jsx index bb429789..512b0985 100644 --- a/src/components/Project/MapUsers.jsx +++ b/src/components/Project/MapUsers.jsx @@ -14,9 +14,13 @@ const MapUsers = ({ assignedLoading, setAssignedLoading, }) => { - const { employeesList, loading: employeeLoading, error } = useAllEmployees(false); + const { + employeesList, + loading: employeeLoading, + error, + } = useAllEmployees(false); const [selectedEmployees, setSelectedEmployees] = useState([]); - const [ searchText, setSearchText ] = useState( "" ); + const [searchText, setSearchText] = useState(""); const handleAllocationData = Array.isArray(allocation) ? allocation : []; @@ -96,9 +100,8 @@ const MapUsers = ({ }); }; - const handleSubmit = () => - { - setAssignedLoading(true) + const handleSubmit = () => { + setAssignedLoading(true); const selected = selectedEmployees .filter((emp) => emp.isSelected) .map((emp) => ({ empID: emp.id, jobRoleId: emp.jobRoleId })); @@ -108,32 +111,33 @@ const MapUsers = ({ } else { showToast("Please select Employee", "error"); } - }; return ( <>
-
-
- {(filteredData.length > 0 || - allocationEmployeesData.length > 0)&& ( -
- setSearchQuery(e.target.value)} - /> -
- )} -
+
+
-
-
- Select Employee -
-
+

Assign Employee

+ +
+ {(filteredData.length > 0 || + allocationEmployeesData.length > 0) && ( +
+ setSearchQuery(e.target.value)} + /> +
+ )} + +

Select Employee

+
+
- {employeeLoading && allocationEmployeesData.length === 0 && ( -

Loading...

+ + + )} {!employeeLoading && allocationEmployeesData.length === 0 && filteredData.length === 0 && ( -

All employee assigned to Project.

+ + + )} - {!employeeLoading && allocationEmployeesData.length > 0 && filteredData.length === 0 && ( -

No matching employees found.

- )} + {!employeeLoading && + allocationEmployeesData.length > 0 && + filteredData.length === 0 && ( + + + + )} {(filteredData.length > 0 || allocationEmployeesData.length > 0) && @@ -174,14 +185,11 @@ const MapUsers = ({
{(filteredData.length > 0 || - allocationEmployeesData.length > 0) && ( - - )} + allocationEmployeesData.length > 0) && ( + + )}
Loading..
All employee assigned to Project.
No matching employees found.