Files
astuto/app/javascript/components/Roadmap/PostList.tsx
Riccardo Graziosi a11157295d Various improvements (#325)
* Fix missing translation in roadmap
* Fix resizing of textareas
* Increase line height for small muted texts
* Improve collapsed board list style
* Fix switch on top of header (z-index)
* Fix margin inconsistencies in site settings
* Add user count to site settings
2024-04-10 23:28:58 +02:00

34 lines
817 B
TypeScript

import * as React from 'react';
import I18n from 'i18n-js';
import PostListItem from './PostListItem';
import { CenteredMutedText } from '../common/CustomTexts';
import IPostJSON from '../../interfaces/json/IPost';
import IBoard from '../../interfaces/IBoard';
interface Props {
posts: Array<IPostJSON>;
boards: Array<IBoard>;
}
const PostList = ({ posts, boards }: Props) => (
<div className="postList">
{
posts.length > 0 ?
posts.map((post, i) => (
<PostListItem
id={post.id}
title={post.title}
boardName={boards.find(board => board.id === post.board_id).name}
key={i}
/>
))
:
<CenteredMutedText>{ I18n.t('board.posts_list.empty') }</CenteredMutedText>
}
</div>
);
export default PostList;