wip post widget

This commit is contained in:
john 2025-05-04 13:02:50 +02:00
parent 3c7c2a6957
commit 8e365867bd
3 changed files with 160 additions and 3 deletions

View file

@ -9,5 +9,17 @@ export default function HomePage() {
return result.posts.map((post) => Post.fromDto(post))
}, [])
return <FeedView loadPosts={fetchPosts} />
const handleCreatePost = useCallback(async (content: string, media: File[]) => {
// This is a placeholder for the actual implementation
// In a real app, you would call an API to create a post
console.log('Creating post:', { content, media })
// Simulate API call delay
await new Promise(resolve => setTimeout(resolve, 1000))
// You would typically refresh the feed after creating a post
// This could be done by calling fetchPosts again or by adding the new post to the state
}, [])
return <FeedView loadPosts={fetchPosts} onCreatePost={handleCreatePost} />
}