+ {!selectedAssignment || !editorState ? (
+
+ Select an assignment to edit.
+
+ ) : (
+ <>
+
+
+
User
+
{selectedAssignment.userName}
+
{selectedAssignment.userEmail}
+
+
+
Role Profile
+
{selectedAssignment.roleProfileName}
+
+ {selectedAssignment.roleProfileCode}
+
+
+
+
+
+
+ setEditorState({
+ ...editorState,
+ branchScopeMode: value,
+ branchScopeIds: value === 'selected' ? editorState.branchScopeIds : []
+ })
+ }
+ onIdsChange={(value) =>
+ setEditorState({ ...editorState, branchScopeIds: value })
+ }
+ />
+
+ setEditorState({
+ ...editorState,
+ productTypeScopeMode: value,
+ productTypeScopeIds:
+ value === 'selected' ? editorState.productTypeScopeIds : []
+ })
+ }
+ onIdsChange={(value) =>
+ setEditorState({ ...editorState, productTypeScopeIds: value })
+ }
+ />
+
+
+
+
+
+ setEditorState({ ...editorState, isPrimary: value === true })
+ }
+ />
+ Primary role
+
+
+
+ setEditorState({ ...editorState, isActive: value === true })
+ }
+ />
+ Active
+
+
+
+
+ void handleUpdate()} isLoading={updateMutation.isPending}>
+ Save Assignment
+
+ void deleteMutation.mutateAsync(selectedAssignment.id)}
+ isLoading={deleteMutation.isPending}
+ >
+ Remove Assignment
+
+
+ >
+ )}
+
+