[web] Move declarations closer to where they're used in ComposedMessage
Summary:
Now that we no longer have a separate function and class component, we can localize some of these declarations.
Depends on D13673
Test Plan: Flow
Reviewers: tomek
Reviewed By: tomek
Differential Revision: https://phab.comm.dev/D13674