[lib] Extract initialChatThreadItem
Summary:
This diff extracts some code for determining the initial ChatThreadItem to display while the Promise returned by getFinalChatThreadItem is resolving.
The code is currently in useChatThreadItems, which is the only current caller of useCreateChatThreadItem. In a later diff, we'll be introducing another caller of useCreateChatThreadItem that also needs this.
To share the code, this diff moves the logic into useCreateChatThreadItem, which now returns it as part of CreatedChatThreadItem.
Depends on D14137
Test Plan: I tested this task by playing around with the ChatThreadList on mobile while using a stopwatch to measure how long various operations took. I tested the updated code 3 times against both the most recent Testflight build as well as master. I found that performance was approximately the same as before. I tested scrolling down, selecting threads that were read, selecting threads that were unread, and search.
Reviewers: tomek, angelika
Reviewed By: tomek
Differential Revision: https://phab.comm.dev/D14138