Initial scaffold: Researcher Endorsement frontend
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
18
src/components/Feed.tsx
Normal file
18
src/components/Feed.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import React from 'react'
|
||||
import useAppStore from '../store/useAppStore'
|
||||
import PostCard from './PostCard'
|
||||
|
||||
const Feed: React.FC = () => {
|
||||
const posts = useAppStore((s) => s.posts)
|
||||
const sorted = [...posts].sort((a,b) => b.createdAt - a.createdAt)
|
||||
if (sorted.length === 0) return <div className="card">No posts yet.</div>
|
||||
return (
|
||||
<div>
|
||||
{sorted.map((p) => (
|
||||
<PostCard key={p.id} post={p} />
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Feed
|
||||
Reference in New Issue
Block a user