2018-11-04 06:22:46 +00:00
|
|
|
import React, { memo } from 'react';
|
2020-06-30 11:24:23 +00:00
|
|
|
import Text from 'components/Text';
|
2018-04-05 19:13:32 +00:00
|
|
|
import { timestamp, linkify } from 'utils';
|
2016-01-22 23:41:35 +00:00
|
|
|
|
2018-11-04 06:22:46 +00:00
|
|
|
const SearchResult = ({ result }) => {
|
|
|
|
const style = {
|
|
|
|
paddingLeft: `${window.messageIndent}px`,
|
|
|
|
textIndent: `-${window.messageIndent}px`
|
|
|
|
};
|
2016-01-22 23:41:35 +00:00
|
|
|
|
2018-11-04 06:22:46 +00:00
|
|
|
return (
|
|
|
|
<p className="search-result" style={style}>
|
|
|
|
<span className="message-time">
|
|
|
|
{timestamp(new Date(result.time * 1000))}
|
|
|
|
</span>
|
|
|
|
<span>
|
|
|
|
{' '}
|
|
|
|
<span className="message-sender">{result.from}</span>
|
|
|
|
</span>
|
2020-06-30 11:24:23 +00:00
|
|
|
<span>
|
|
|
|
{' '}
|
|
|
|
<Text>{linkify(result.content)}</Text>
|
|
|
|
</span>
|
2018-11-04 06:22:46 +00:00
|
|
|
</p>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default memo(SearchResult);
|