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-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={
|
|
|
|
|
"postStatusListItemContainer " + `postStatus${name.replace(/ /g, '')} d-flex align-self-stretch`
|
|
|
|
|
}>
|
|
|
|
|
<a onClick={handleClick} className="postStatusListItemLink flex-grow-1">
|
|
|
|
|
<div className="postStatusListItem p-1">
|
2019-09-12 18:03:19 +02:00
|
|
|
<PostStatusLabel id={undefined} name={name} color={color} />
|
2019-09-03 12:58:44 +02:00
|
|
|
</div>
|
|
|
|
|
</a>
|
|
|
|
|
{
|
|
|
|
|
isCurrentFilter ?
|
2019-09-15 18:26:51 +02:00
|
|
|
<button onClick={handleResetFilter}
|
|
|
|
|
className="resetFilter btn btn-outline-dark">X</button>
|
|
|
|
|
:
|
|
|
|
|
null
|
2019-09-03 12:58:44 +02:00
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export default PostStatusListItem;
|