1
1
import Image from 'next/image' ;
2
2
import { useFormatter , useNow , useTimeZone , useTranslations } from 'next-intl' ;
3
+ import { use } from 'react' ;
3
4
import DropdownMenu from '@/components/DropdownMenu' ;
4
5
import RichText from '@/components/RichText' ;
5
6
import { Link } from '@/i18n/routing' ;
6
- import AsyncComponent from '../../components/AsyncComponent' ;
7
+ import AsyncComponent , {
8
+ AsyncComponentGerman
9
+ } from '../../components/AsyncComponent' ;
7
10
import AsyncComponentWithNamespaceAndLocale from '../../components/AsyncComponentWithNamespaceAndLocale' ;
8
11
import AsyncComponentWithoutNamespace from '../../components/AsyncComponentWithoutNamespace' ;
9
12
import AsyncComponentWithoutNamespaceAndLocale from '../../components/AsyncComponentWithoutNamespaceAndLocale' ;
@@ -16,7 +19,7 @@ import MessagesAsPropsCounter from '../../components/client/01-MessagesAsPropsCo
16
19
import MessagesOnClientCounter from '../../components/client/02-MessagesOnClientCounter' ;
17
20
18
21
type Props = {
19
- searchParams : Record < string , string > ;
22
+ searchParams : Promise < Record < string , string > > ;
20
23
} ;
21
24
22
25
export default function Index ( { searchParams} : Props ) {
@@ -55,11 +58,14 @@ export default function Index({searchParams}: Props) {
55
58
</ Link >
56
59
</ div >
57
60
< ClientLink href = "/" > Link on client without provider</ ClientLink >
58
- < p data-testid = "SearchParams" > { JSON . stringify ( searchParams , null , 2 ) } </ p >
61
+ < p data-testid = "SearchParams" >
62
+ { JSON . stringify ( use ( searchParams ) , null , 2 ) }
63
+ </ p >
59
64
< p data-testid = "HasTitle" > { JSON . stringify ( t . has ( 'title' ) ) } </ p >
60
65
< Image alt = "" height = { 77 } priority src = "/assets/image.jpg" width = { 128 } />
61
66
< AsyncComponent />
62
67
< AsyncComponentWithNamespaceAndLocale />
68
+ < AsyncComponentGerman />
63
69
< AsyncComponentWithoutNamespace />
64
70
< AsyncComponentWithoutNamespaceAndLocale />
65
71
< DropdownMenu />
0 commit comments