2019-09-02 19:26:34 +02:00
|
|
|
import * as React from 'react';
|
|
|
|
|
|
2019-09-11 18:30:59 +02:00
|
|
|
import IPostStatus from '../../interfaces/IPostStatus';
|
|
|
|
|
|
2019-09-02 19:26:34 +02:00
|
|
|
interface Props {
|
|
|
|
|
title: string;
|
|
|
|
|
description?: string;
|
2019-09-11 18:30:59 +02:00
|
|
|
postStatus: IPostStatus;
|
2019-09-02 19:26:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const PostListItem = ({ title, description, postStatus}: Props) => (
|
|
|
|
|
<a href="#" className="postLink">
|
|
|
|
|
<div className="postListItem">
|
|
|
|
|
<div className="postTitle">{title}</div>
|
|
|
|
|
<div className="postDescription">
|
|
|
|
|
{
|
|
|
|
|
description && description.length > 120 ?
|
|
|
|
|
description.slice(0, 119) + '...'
|
|
|
|
|
:
|
|
|
|
|
description || '<No description provided.>'
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
<div className="postDetails">
|
2019-09-02 20:26:09 +02:00
|
|
|
<div className="postDetailsComments">
|
|
|
|
|
<span className="comment icon"></span>
|
|
|
|
|
<span>0 comments</span>
|
|
|
|
|
</div>
|
2019-09-11 18:30:59 +02:00
|
|
|
{
|
|
|
|
|
postStatus ?
|
|
|
|
|
<div className="postDetailsStatus">
|
|
|
|
|
<div className="dot" style={{backgroundColor: postStatus.color}}></div>
|
|
|
|
|
<span className="postStatusName">{postStatus.name}</span>
|
|
|
|
|
</div>
|
|
|
|
|
:
|
|
|
|
|
null
|
|
|
|
|
}
|
2019-09-02 19:26:34 +02:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</a>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export default PostListItem;
|