import Layout from '../../../components/layout' import { useRouter } from 'next/router' import { getGetServerSideProps } from '../../../api/ssrApollo' import TopHeader from '../../../components/top-header' import { TOP_COMMENTS } from '../../../fragments/comments' import CommentsFlat from '../../../components/comments-flat' export const getServerSideProps = getGetServerSideProps(TOP_COMMENTS) export default function Index ({ data: { topComments: { comments, cursor } } }) { const router = useRouter() return ( data.topComments} variables={{ sort: router.query.sort, when: router.query.when }} includeParent noReply /> ) }