[web, lib] Extract function for modyfing items to be displayed in MessageResult
Summary:
issue: https://linear.app/comm/issue/ENG-3462/add-modal-for-searching-messages and https://linear.app/comm/issue/ENG-4092/pin-message-modal-displaying-the-message-incorrectly
Extracting a function that will be needed in message search. Using it in TogglePinModal to fix avatar not showing because startsCluster and endsCluster were not being set to true.
Test Plan: Checked that avatars show in TogglePinModal for messages in the middle of the cluster, checked that pinned messages modal still works.
Reviewers: rohan
Reviewed By: rohan
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D8199