2019-09-03 12:58:44 +02:00
|
|
|
import * as React from 'react';
|
|
|
|
|
|
2019-09-12 18:03:19 +02:00
|
|
|
import PostStatusLabel from '../shared/PostStatusLabel';
|
2019-09-16 12:22:30 +02:00
|
|
|
import Button from '../shared/Button';
|
2019-09-12 18:03:19 +02:00
|
|
|
|
2019-09-03 12:58:44 +02:00
|
|
|
interface Props {
|
|
|
|
|
name: string;
|
|
|
|
|
color: string;
|
|
|
|
|
|
|
|
|
|
handleClick(): void;
|
|
|
|
|
isCurrentFilter: boolean;
|
|
|
|
|
handleResetFilter(): void;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const PostStatusListItem = ({
|
|
|
|
|
name,
|
|
|
|
|
color,
|
|
|
|
|
handleClick,
|
|
|
|
|
isCurrentFilter,
|
|
|
|
|
handleResetFilter,
|
|
|
|
|
}: Props) => (
|
2019-09-15 18:26:51 +02:00
|
|
|
<div className={
|
2019-09-16 12:22:30 +02:00
|
|
|
"postStatusListItemContainer " + `postStatus${name.replace(/ /g, '')}`
|
2019-09-15 18:26:51 +02:00
|
|
|
}>
|
2019-09-16 12:22:30 +02:00
|
|
|
<a onClick={handleClick} className="postStatusListItemLink">
|
|
|
|
|
<div className="postStatusListItem">
|
2019-09-26 11:00:32 +02:00
|
|
|
<PostStatusLabel name={name} color={color} />
|
2019-09-03 12:58:44 +02:00
|
|
|
</div>
|
|
|
|
|
</a>
|
|
|
|
|
{
|
|
|
|
|
isCurrentFilter ?
|
2019-09-16 12:22:30 +02:00
|
|
|
<Button onClick={handleResetFilter} className="resetFilter" outline>
|
|
|
|
|
X
|
|
|
|
|
</Button>
|
2019-09-15 18:26:51 +02:00
|
|
|
:
|
|
|
|
|
null
|
2019-09-03 12:58:44 +02:00
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export default PostStatusListItem;
|