2023-04-22 16:41:13 +02:00
|
|
|
// Hooks
|
|
|
|
import { useApp } from 'shared/hooks/use-app.mjs'
|
2023-02-26 16:11:10 +01:00
|
|
|
// Dependencies
|
|
|
|
import dynamic from 'next/dynamic'
|
|
|
|
import { serverSideTranslations } from 'next-i18next/serverSideTranslations'
|
|
|
|
// Components
|
2023-03-27 19:07:48 +02:00
|
|
|
import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs'
|
|
|
|
import { ns as authNs } from 'shared/components/wrappers/auth/index.mjs'
|
|
|
|
import { ns as apikeysNs } from 'shared/components/account/apikeys.mjs'
|
2023-02-26 16:11:10 +01:00
|
|
|
|
|
|
|
// Translation namespaces used on this page
|
|
|
|
const namespaces = [...new Set([...apikeysNs, ...authNs, ...pageNs])]
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Some things should never generated as SSR
|
|
|
|
* So for these, we run a dynamic import and disable SSR rendering
|
|
|
|
*/
|
|
|
|
const DynamicAuthWrapper = dynamic(
|
2023-03-27 19:07:48 +02:00
|
|
|
() => import('shared/components/wrappers/auth/index.mjs').then((mod) => mod.AuthWrapper),
|
2023-02-26 16:11:10 +01:00
|
|
|
{ ssr: false }
|
|
|
|
)
|
|
|
|
|
2023-04-22 16:41:13 +02:00
|
|
|
const DynamicSets = dynamic(
|
|
|
|
() => import('shared/components/account/sets.mjs').then((mod) => mod.Sets),
|
2023-02-26 16:11:10 +01:00
|
|
|
{ ssr: false }
|
|
|
|
)
|
|
|
|
|
|
|
|
const AccountPage = (props) => {
|
|
|
|
const app = useApp(props)
|
|
|
|
|
|
|
|
return (
|
2023-04-22 16:41:13 +02:00
|
|
|
<PageWrapper app={app}>
|
2023-02-26 16:11:10 +01:00
|
|
|
<DynamicAuthWrapper app={app}>
|
2023-04-22 16:41:13 +02:00
|
|
|
<DynamicSets app={app} />
|
2023-02-26 16:11:10 +01:00
|
|
|
</DynamicAuthWrapper>
|
|
|
|
</PageWrapper>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default AccountPage
|
|
|
|
|
|
|
|
export async function getStaticProps({ locale }) {
|
|
|
|
return {
|
|
|
|
props: {
|
|
|
|
...(await serverSideTranslations(locale, namespaces)),
|
2023-04-16 19:18:24 +02:00
|
|
|
page: {
|
|
|
|
path: ['account', 'sets'],
|
|
|
|
},
|
2023-02-26 16:11:10 +01:00
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|