import Layout from '../../../components/layout'
import { useRouter } from 'next/router'
import { getGetServerSideProps } from '../../../api/ssrApollo'
import TopHeader from '../../../components/top-header'
import { TOP_USERS } from '../../../fragments/users'
import { useQuery } from '@apollo/client'
import Link from 'next/link'
import MoreFooter from '../../../components/more-footer'
export const getServerSideProps = getGetServerSideProps(TOP_USERS)
export default function Index ({ data: { topUsers: { users, cursor } } }) {
const router = useRouter()
const { data, fetchMore } = useQuery(TOP_USERS, {
variables: { within: router.query?.within }
})
if (data) {
({ topUsers: { users, cursor } } = data)
}
return (
@{user.name}
{user.stacked} stacked