- {filteredUsers.map((user) => (
-
handleUserSelect(user.id)}
+ const handleRoleSelect = useCallback(
+ (data) => {
+ onCreate({
+ userId: step.params.userId,
+ ...data,
+ });
+
+ onClose();
+ },
+ [onCreate, onClose, step],
+ );
+
+ useEffect(() => {
+ searchField.current.focus();
+ }, []);
+
+ if (step) {
+ switch (step.type) {
+ case StepTypes.SELECT_PERMISSIONS: {
+ const currentUser = users.find((user) => user.id === step.params.userId);
+
+ if (currentUser) {
+ const PermissionsSelectStep = permissionsSelectStep;
+
+ return (
+
- ))}
-
- )}
-