-
-
Notifications
You must be signed in to change notification settings - Fork 250
/
page.tsx
42 lines (31 loc) · 1.02 KB
/
page.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
export function generateStaticParams() {
return ['de', 'en'].map((locale) => ({locale}));
}
type Props = {
params: {
locale: string;
};
};
export default function Index({params: {locale}}: Props) {
// TODO: Validate locale or redirect to default locale
return <p>Hello {locale}</p>;
}
// import {useTranslations} from 'next-intl';
// import LocaleSwitcher from 'components/LocaleSwitcher';
// import PageLayout from 'components/PageLayout';
// import {useContext} from 'react';
// import ServerOnlyContext from './ServerOnlyContext';
// export default function Index() {
// // TODO: Use middleware to redirect to a specific locale
// const serverOnly = useContext(ServerOnlyContext);
// // const t = useTranslations('Index');
// console.log('Index');
// // return <p>{t('title')}</p>;
// return <p>Hello {serverOnly.only.for.server + 10}</p>;
// // return (
// // <PageLayout title={t('title')}>
// // <p>{t('description')}</p>
// // <LocaleSwitcher />
// // </PageLayout>
// // );
// }