import Layout from '../../components/layout' import Items from '../../components/items' import { useRouter } from 'next/router' import getSSRApolloClient from '../../api/ssrApollo' import { MORE_ITEMS } from '../../fragments/items' import { Nav, Navbar } from 'react-bootstrap' import styles from '../../components/header.module.css' import Link from 'next/link' export async function getServerSideProps ({ req }) { const client = await getSSRApolloClient(req) const { data } = await client.query({ query: MORE_ITEMS, variables: { sort: 'top', within: req.query?.within?.pop() } }) let items, cursor if (data) { ({ moreItems: { items, cursor } } = data) } return { props: { items, cursor } } } export default function Index ({ items, cursor }) { const router = useRouter() const path = router.asPath.split('?')[0] return ( ) }