@@ -8,9 +8,9 @@ import { ComponentsView } from "../../../components/components-view";
8
8
import { IconArrowLeft } from "../../../components/icons/icon-arrow-left" ;
9
9
10
10
interface ComponentPageParams {
11
- params : {
11
+ params : Promise < {
12
12
slug : string ;
13
- } ;
13
+ } > ;
14
14
}
15
15
16
16
export const dynamic = "force-static" ;
@@ -24,9 +24,10 @@ export const generateStaticParams = async () => {
24
24
export const generateMetadata = async ( {
25
25
params,
26
26
} : {
27
- params : { slug : string } ;
27
+ params : Promise < { slug : string } > ;
28
28
} ) => {
29
- const slug = decodeURIComponent ( params . slug ) ;
29
+ const { slug : rawSlug } = await params ;
30
+ const slug = decodeURIComponent ( rawSlug ) ;
30
31
const foundCategory = componentsStructure . find (
31
32
( category ) => slugify ( category . name ) === slug ,
32
33
) ;
@@ -48,13 +49,14 @@ export const generateMetadata = async ({
48
49
] ,
49
50
} ,
50
51
alternates : {
51
- canonical : `/components/${ params . slug } ` ,
52
+ canonical : `/components/${ rawSlug } ` ,
52
53
} ,
53
54
} ;
54
55
} ;
55
56
56
57
const ComponentPage : React . FC < ComponentPageParams > = async ( { params } ) => {
57
- const slug = decodeURIComponent ( params . slug ) ;
58
+ const { slug : rawSlug } = await params ;
59
+ const slug = decodeURIComponent ( rawSlug ) ;
58
60
const foundCategory = componentsStructure . find (
59
61
( category ) => slugify ( category . name ) === slug ,
60
62
) ;
0 commit comments