2023-07-23 15:08:43 +00:00
|
|
|
import { useRouter } from 'next/router'
|
|
|
|
import { getGetServerSideProps } from '../../api/ssrApollo'
|
|
|
|
import Items from '../../components/items'
|
|
|
|
import Layout from '../../components/layout'
|
|
|
|
import { SUB_ITEMS } from '../../fragments/subs'
|
2023-08-25 23:43:50 +00:00
|
|
|
import Snl from '../../components/snl'
|
2023-09-11 21:29:45 +00:00
|
|
|
import WelcomeBanner from '../../components/banners'
|
2023-07-23 15:08:43 +00:00
|
|
|
|
2023-08-28 17:52:15 +00:00
|
|
|
export const getServerSideProps = getGetServerSideProps({
|
|
|
|
query: SUB_ITEMS,
|
|
|
|
notFound: (data, vars) => vars.sub && !data.sub
|
|
|
|
})
|
2023-07-23 15:08:43 +00:00
|
|
|
|
|
|
|
export default function Sub ({ ssrData }) {
|
|
|
|
const router = useRouter()
|
|
|
|
const variables = { ...router.query }
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Layout sub={variables.sub}>
|
2023-08-25 23:43:50 +00:00
|
|
|
<Snl />
|
2023-09-11 21:29:45 +00:00
|
|
|
<WelcomeBanner />
|
2023-07-25 14:14:45 +00:00
|
|
|
<Items ssrData={ssrData} variables={variables} />
|
2023-07-23 15:08:43 +00:00
|
|
|
</Layout>
|
|
|
|
)
|
|
|
|
}
|