mirror of
https://github.com/astuto/astuto.git
synced 2025-12-15 11:17:49 +01:00
33 lines
794 B
TypeScript
33 lines
794 B
TypeScript
import * as React from 'react';
|
|
|
|
import PostListItem from './PostListItem';
|
|
import { CenteredMutedText } from '../shared/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>There are no posts that have this status.</CenteredMutedText>
|
|
}
|
|
</div>
|
|
);
|
|
|
|
export default PostList; |