2017-02-17 00:46:39 +00:00
|
|
|
import React, { PureComponent } from 'react';
|
2018-04-05 19:13:32 +00:00
|
|
|
import { timestamp, linkify } from 'utils';
|
2016-01-22 23:41:35 +00:00
|
|
|
|
2017-03-24 20:18:02 +00:00
|
|
|
export default class SearchResult extends PureComponent {
|
2016-01-22 23:41:35 +00:00
|
|
|
render() {
|
|
|
|
const { result } = this.props;
|
|
|
|
const style = {
|
2016-02-04 02:35:50 +00:00
|
|
|
paddingLeft: `${window.messageIndent}px`,
|
|
|
|
textIndent: `-${window.messageIndent}px`
|
2016-01-22 23:41:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
return (
|
|
|
|
<p className="search-result" style={style}>
|
2018-04-05 23:46:22 +00:00
|
|
|
<span className="message-time">
|
|
|
|
{timestamp(new Date(result.time * 1000))}
|
|
|
|
</span>
|
2016-01-22 23:41:35 +00:00
|
|
|
<span>
|
|
|
|
{' '}
|
|
|
|
<span className="message-sender">{result.from}</span>
|
|
|
|
</span>
|
2018-04-05 23:46:22 +00:00
|
|
|
<span> {linkify(result.content)}</span>
|
2016-01-22 23:41:35 +00:00
|
|
|
</p>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|