lbry-desktop/src/ui/component/comment/view.jsx

35 lines
797 B
React
Raw Normal View History

2019-06-27 01:59:27 +02:00
// @flow
import React from 'react';
import relativeDate from 'tiny-relative-date';
2019-07-21 22:46:30 +02:00
import Button from 'component/button';
2019-06-27 01:59:27 +02:00
type Props = {
author: string,
authorUri: string,
2019-06-27 01:59:27 +02:00
message: string,
timePosted: number,
};
function Comment(props: Props) {
const { author, authorUri, timePosted, message } = props;
2019-06-27 01:59:27 +02:00
return (
<li className="comment">
<div className="comment__meta">
2019-07-23 10:05:51 +02:00
<Button
className="button--uri-indicator truncated-text comment__author"
navigate={authorUri}
label={author || __('Anonymous')}
/>
<time className="comment__time" dateTime={timePosted}>
{relativeDate(timePosted)}
</time>
2019-06-27 01:59:27 +02:00
</div>
<p className={'comment__message'}>{message}</p>
2019-06-27 01:59:27 +02:00
</li>
);
}
export default Comment;