Files
astuto/app/javascript/components/Board/PostStatusListItem.tsx

34 lines
823 B
TypeScript
Raw Normal View History

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) => (
<div className={"postStatusListItemContainer " + `postStatus${name.replace(/ /g, '')}`}>
2019-09-03 12:58:44 +02:00
<a onClick={handleClick} className="postStatusListItemLink">
<div className="postStatusListItem">
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 ?
<button onClick={handleResetFilter} className="btn btn-outline-dark resetFilter">X</button> : null
}
</div>
);
export default PostStatusListItem;