wip add button and feed stuff

This commit is contained in:
john 2025-05-03 23:40:30 +02:00
parent 38d09a582c
commit 1c2d6d60a6
11 changed files with 211 additions and 46 deletions

14
src/pages/HomePage.tsx Normal file
View file

@ -0,0 +1,14 @@
import { useCallback } from 'react'
import { Post } from '../model/posts/posts.ts'
import './FeedView.css'
import { loadPublicFeed } from '../api/api.ts'
import FeedView from './FeedView.tsx'
export default function HomePage() {
const fetchPosts = useCallback(async (cursor: string | null, amount: number | null) => {
const result = await loadPublicFeed(cursor, amount)
return result.posts.map((post) => Post.fromDto(post))
}, [])
return <FeedView loadPosts={fetchPosts} />
}