webapp/src/pages/topics.astro
2022-09-14 18:44:06 +03:00

16 lines
498 B
Plaintext

---
import { AllTopicsPage } from '../components/Views/AllTopics'
import Zine from '../layouts/zine.astro'
import { apiClient } from '../utils/apiClient'
import { sortBy } from '../utils/sortby'
const { by } = Object.fromEntries(Astro.url.searchParams.entries())
let topics = await apiClient.getAllTopics()
topics = sortBy(topics, by || 'shouts')
Astro.response.headers.set('Cache-Control', 's-maxage=1, stale-while-revalidate')
---
<Zine>
<AllTopicsPage topics={topics} client:load />
</Zine>