// Dependencies import { serverSideTranslations } from 'next-i18next/serverSideTranslations' // Hooks import { useTranslation } from 'next-i18next' import { useAccount } from 'shared/hooks/use-account.mjs' // Components import Link from 'next/link' import { PageWrapper, ns as pageNs } from 'shared/components/wrappers/page.mjs' import { KeyIcon, NewMsetIcon, DesignIcon, NewPatternIcon, PluginIcon, ShowcaseIcon, RssIcon, CsetIcon, // OpackIcon, KioskIcon, } from 'shared/components/icons.mjs' // Translation namespaces used on this page // Note that we include the account namespace here for the 'new' keyword const namespaces = [...pageNs, 'account'] const Box = ({ title, Icon, description, href }) => { const linkProps = { href, className: 'p-8 -ml-4 -mr-4 md:m-0 rounded-none md:rounded-xl md:shadow hover:bg-secondary bg-base-200 hover:bg-opacity-10 w-full max-w-lg', } const inner = ( <>

{title}

{description}
) return href.slice(0, 4) === 'http' ? ( {inner} ) : ( {inner} ) } /* */ /* * Each page MUST be wrapped in the PageWrapper component. * You also MUST spread props.page into this wrapper component * when path and locale come from static props (as here) * or set them manually. */ const NewIndexPage = ({ page }) => { const { t } = useTranslation(['account']) const { account } = useAccount() const control = account.control ? account.control : 99 return (

{t('newPopular')}

{control > 3 ? ( <>

{t('newShare')}

{t('newDev')}

) : null}
) } export default NewIndexPage export async function getStaticProps({ locale }) { return { props: { ...(await serverSideTranslations(locale, namespaces)), page: { locale, path: ['new'], }, }, } }