@@ -2,6 +2,7 @@ import { TextInput, ActionMenu, ActionList, Button, Box } from '@primer/react'
2
2
import { SearchIcon } from '@primer/octicons-react'
3
3
import { useRef , useEffect , useState } from 'react'
4
4
import { ArticleCardItems } from '#src/landings/types.ts'
5
+ import { useTranslation } from 'src/languages/components/useTranslation'
5
6
6
7
type Props = {
7
8
tokens : ArticleCardItems
@@ -23,6 +24,7 @@ export const CookBookFilter = ({
23
24
'All' ,
24
25
...new Set ( tokens . flatMap ( ( item ) => item . complexity || [ ] ) ) ,
25
26
]
27
+ const { t } = useTranslation ( 'cookbook_landing' )
26
28
27
29
const [ selectedCategory , setSelectedCategory ] = useState ( 0 )
28
30
const [ selectedComplexity , setSelectedComplexity ] = useState ( 0 )
@@ -61,7 +63,7 @@ export const CookBookFilter = ({
61
63
leadingVisual = { SearchIcon }
62
64
className = "m-1"
63
65
sx = { { minWidth : [ 'stretch' , 'stretch' , 'stretch' , 'stretch' ] } }
64
- placeholder = "Search articles"
66
+ placeholder = { t ( 'search_articles' ) }
65
67
ref = { inputRef }
66
68
autoComplete = "false"
67
69
onChange = { ( e ) => {
@@ -80,7 +82,7 @@ export const CookBookFilter = ({
80
82
display : 'inline-block' ,
81
83
} }
82
84
>
83
- Category :
85
+ { t ( 'category' ) } :
84
86
</ Box > { ' ' }
85
87
{ categories [ selectedCategory ] }
86
88
</ ActionMenu . Button >
@@ -107,7 +109,7 @@ export const CookBookFilter = ({
107
109
display : 'inline-block' ,
108
110
} }
109
111
>
110
- Complexity :
112
+ { t ( 'complexity' ) } :
111
113
</ Box > { ' ' }
112
114
{ complexities [ selectedComplexity ] }
113
115
</ ActionMenu . Button >
@@ -127,7 +129,7 @@ export const CookBookFilter = ({
127
129
</ ActionMenu >
128
130
129
131
< Button variant = "invisible" className = "col-md-1 col-sm-2 mt-1" onClick = { onResetFilter } >
130
- Reset filters
132
+ { t ( 'reset_filters' ) }
131
133
</ Button >
132
134
</ div >
133
135
</ div >
0 commit comments