text: import {createSelector} from 'reselect';
  import {formatDate} from '@webex/react-component-utils';
  
  const getConversation = (state) => state.conversation;
  const getShare = (state) => state.share;
  
  const getFilesWidgetProps = createSelector(
    [getConversation, getShare],
    (conversation, share) => {
      const fileShares = [];
  
      conversation
        .get('activities')
        .filter((activity) => activity.verb === 'share')
        .forEach((activity) => {
          if (activity.object.files && activity.object.files.items.length) {
            activity.object.files.items.forEach((fileItem) => {
              let isFetching = false;
              let objectUrl;
  
              if (fileItem.image) {
                const thumbnail = fileItem.mimeType === 'image/gif' ? share.getIn(['files', fileItem.url]) : share.getIn(['files', fileItem.image.url]);
  
                if (thumbnail) {
                  isFetching = thumbnail.get('isFetching');
                  objectUrl = thumbnail.get('objectUrl');
                }
              }
              const fileShare = {
                actor: activity.actor,
                activityId: activity.id,
                item: {
                  ...fileItem,
                  isFetching,
                  objectUrl
                },
                timestamp: formatDate(activity.published)
              };
  
              fileShares.push(fileShare);
            });
          }
        });
  
      return {fileShares};
    }
  );
  
  export default getFilesWidgetProps;
  