2019-09-02 19:26:34 +02:00
|
|
|
import * as React from 'react';
|
|
|
|
|
|
2019-09-15 18:26:51 +02:00
|
|
|
import CommentsNumber from '../shared/CommentsNumber';
|
2019-09-12 18:03:19 +02:00
|
|
|
import PostStatusLabel from '../shared/PostStatusLabel';
|
2019-09-15 18:26:51 +02:00
|
|
|
import { TitleText, DescriptionText } from '../shared/CustomTexts';
|
2019-09-12 18:03:19 +02:00
|
|
|
|
2019-09-11 18:30:59 +02:00
|
|
|
import IPostStatus from '../../interfaces/IPostStatus';
|
|
|
|
|
|
2019-09-02 19:26:34 +02:00
|
|
|
interface Props {
|
2019-09-12 15:51:45 +02:00
|
|
|
id: number;
|
2019-09-02 19:26:34 +02:00
|
|
|
title: string;
|
|
|
|
|
description?: string;
|
2019-09-11 18:30:59 +02:00
|
|
|
postStatus: IPostStatus;
|
2019-09-02 19:26:34 +02:00
|
|
|
}
|
|
|
|
|
|
2019-09-12 15:51:45 +02:00
|
|
|
const PostListItem = ({ id, title, description, postStatus}: Props) => (
|
|
|
|
|
<a href={`/posts/${id}`} className="postLink">
|
2019-09-16 12:22:30 +02:00
|
|
|
<div className="postListItem">
|
2019-09-19 16:42:43 +02:00
|
|
|
<span className="postTitle">{title}</span>
|
2019-09-15 18:26:51 +02:00
|
|
|
<DescriptionText limit={120}>{description}</DescriptionText>
|
|
|
|
|
|
2019-09-16 12:22:30 +02:00
|
|
|
<div className="postDetails">
|
2019-09-15 18:26:51 +02:00
|
|
|
<CommentsNumber number={0} />
|
2019-09-12 18:03:19 +02:00
|
|
|
{ postStatus ? <PostStatusLabel {...postStatus} /> : null }
|
2019-09-02 19:26:34 +02:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</a>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export default PostListItem;
|