2023-05-01 20:58:30 +00:00
|
|
|
import { getGetServerSideProps } from '../../../../api/ssrApollo'
|
|
|
|
import Items from '../../../../components/items'
|
|
|
|
import Layout from '../../../../components/layout'
|
|
|
|
import RecentHeader from '../../../../components/recent-header'
|
|
|
|
import { SUB_ITEMS } from '../../../../fragments/subs'
|
|
|
|
|
|
|
|
const variables = { sort: 'recent' }
|
|
|
|
export const getServerSideProps = getGetServerSideProps(SUB_ITEMS, variables,
|
|
|
|
data => !data.sub)
|
|
|
|
|
|
|
|
// need to recent list items
|
|
|
|
export default function Sub ({ data: { sub, items: { items, cursor } } }) {
|
|
|
|
return (
|
|
|
|
<Layout sub={sub?.name}>
|
2023-05-11 00:26:07 +00:00
|
|
|
{sub?.name !== 'jobs' && <RecentHeader type='posts' sub={sub} />}
|
2023-05-01 20:58:30 +00:00
|
|
|
<Items
|
|
|
|
items={items} cursor={cursor}
|
|
|
|
variables={{ sub: sub?.name, ...variables }} rank
|
|
|
|
/>
|
|
|
|
</Layout>
|
|
|
|
)
|
|
|
|
}
|