---
import { Root } from '../components/Root'
import Prerendered from '../main.astro'
import { apiClient } from '../utils/apiClient'
import { initRouter } from '../stores/router'

const topics = await apiClient.getAllTopics()

const { pathname, search } = Astro.url
initRouter(pathname, search)
---

<Prerendered>
  <Root allTopics={topics} client:load />
</Prerendered>

