webapp/src/pages/feed/index.astro

16 lines
579 B
Plaintext
Raw Normal View History

2022-09-09 11:53:35 +00:00
---
import { FeedPage } from '../../components/Views/Feed'
import Zine from '../../layouts/zine.astro'
import { apiClient } from '../../utils/apiClient'
2022-09-14 11:27:10 +00:00
const limit = parseInt(Astro.params?.limit as string, 10) || 50
const offset = parseInt(Astro.params?.offset as string, 10) || 0
const recentArticles = await apiClient.getRecentArticles({ limit, offset })
2022-09-09 11:53:35 +00:00
const shoutSlugs = recentArticles.map((s) => s.slug)
const reactions = await apiClient.getReactionsForShouts({ shoutSlugs })
---
<Zine>
2022-09-13 09:59:04 +00:00
<FeedPage articles={recentArticles} reactions={reactions} client:load />
2022-09-09 11:53:35 +00:00
</Zine>