+ const currentUserUUID = getUserUuid(state);
+ const item = getResource<CollectionResource>(props.match.params.id)(state.resources);
+ let isWritable = false;
+ if (item && item.ownerUuid === currentUserUUID) {
+ isWritable = true;
+ } else if (item) {
+ const itemOwner = getResource<GroupResource|UserResource>(item.ownerUuid)(state.resources);
+ if (itemOwner) {
+ isWritable = itemOwner.writableBy.indexOf(currentUserUUID || '') >= 0;
+ }
+ }
+ const loadingFilesIndicator = getProgressIndicator(COLLECTION_PANEL_LOAD_FILES)(state.progressIndicator);
+ const isLoadingFiles = loadingFilesIndicator && loadingFilesIndicator!.working || false;
+ const tooManyFiles = !state.collectionPanel.loadBigCollections && item && item.fileCount > COLLECTION_PANEL_LOAD_FILES_THRESHOLD || false;
+ return { item, isWritable, isLoadingFiles, tooManyFiles };