Posts.tsx 643 B

1234567891011121314151617181920212223242526272829
  1. import React from "react";
  2. import { Handles, Thread, Post } from "../../types";
  3. import PostBox from "./PostBox";
  4. const Posts = (props: {
  5. startTime: number;
  6. handles: Handles;
  7. thread?: Thread;
  8. posts: Post[];
  9. }) => {
  10. const { handles, startTime, posts } = props;
  11. return (
  12. <div className="overflow-auto" style={{ height: `90%` }}>
  13. {posts
  14. .sort((a, b) => b.createdAt.block - a.createdAt.block)
  15. .map((post) => (
  16. <PostBox
  17. key={post.id}
  18. handles={handles}
  19. startTime={startTime}
  20. {...post}
  21. />
  22. ))}
  23. </div>
  24. );
  25. };
  26. export default Posts;