File size: 771 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// @flow
import React from 'react';
import compose from 'recompose/compose';
import {
  getThreadById,
  type GetThreadType,
} from 'shared/graphql/queries/thread/getThread';
import type { MessageInfoType } from 'shared/graphql/fragments/message/messageInfo.js';
import type { UserInfoType } from 'shared/graphql/fragments/user/userInfo.js';
import Attachment from './attachment';

export type Props = {
  currentUser: UserInfoType,
  message: MessageInfoType,
  id: string,
  data: {
    thread: GetThreadType,
    loading: boolean,
    error: ?string,
  },
};

const Query = ({ data, message, id, ...rest }: Props) => (
  <Attachment message={message} id={id} data={data} />
);

const ThreadAttachment = compose(getThreadById)(Query);

export default ThreadAttachment;