// @flow import React from 'react'; import { Link } from 'react-router-dom'; import type { Props } from './'; import compose from 'recompose/compose'; import { Loading } from 'src/components/loading'; import { Container, LinkWrapper, AvatarWrapper, Column } from './style'; import Activity from 'src/components/inboxThread/activity'; import { ThreadTitle } from 'src/components/inboxThread/style'; import { UserAvatar } from 'src/components/avatar'; import { withCurrentUser } from 'src/components/withCurrentUser'; import getThreadLink from 'src/helpers/get-thread-link'; class Attachment extends React.Component { render() { const { data, currentUser, id } = this.props; const { thread, loading, error } = data; if (loading) return (
); if (error || !thread) return ( https://spectrum.chat/thread/{id} ); return (
e.stopPropagation()} to={{ pathname: getThreadLink(thread), state: { modal: true } }} /> {thread.content.title}
); } } export default compose(withCurrentUser)(Attachment);