dispatch/client/js/components/pages/Chat/SearchResult.js

25 lines
599 B
JavaScript
Raw Normal View History

import React, { memo } from 'react';
import { timestamp, linkify } from 'utils';
2016-01-22 23:41:35 +00:00
const SearchResult = ({ result }) => {
const style = {
paddingLeft: `${window.messageIndent}px`,
textIndent: `-${window.messageIndent}px`
};
2016-01-22 23:41:35 +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>
<span> {linkify(result.content)}</span>
</p>
);
};
export default memo(SearchResult);