@@ -2,6 +2,7 @@ import { TextInput, ActionMenu, ActionList, Button, Box } from '@primer/react'
22import { SearchIcon } from '@primer/octicons-react'
33import { useRef , useEffect , useState } from 'react'
44import { ArticleCardItems } from '#src/landings/types.ts'
5+ import { useTranslation } from 'src/languages/components/useTranslation'
56
67type Props = {
78 tokens : ArticleCardItems
@@ -23,6 +24,7 @@ export const CookBookFilter = ({
2324 'All' ,
2425 ...new Set ( tokens . flatMap ( ( item ) => item . complexity || [ ] ) ) ,
2526 ]
27+ const { t } = useTranslation ( 'cookbook_landing' )
2628
2729 const [ selectedCategory , setSelectedCategory ] = useState ( 0 )
2830 const [ selectedComplexity , setSelectedComplexity ] = useState ( 0 )
@@ -61,7 +63,7 @@ export const CookBookFilter = ({
6163 leadingVisual = { SearchIcon }
6264 className = "m-1"
6365 sx = { { minWidth : [ 'stretch' , 'stretch' , 'stretch' , 'stretch' ] } }
64- placeholder = "Search articles"
66+ placeholder = { t ( 'search_articles' ) }
6567 ref = { inputRef }
6668 autoComplete = "false"
6769 onChange = { ( e ) => {
@@ -80,7 +82,7 @@ export const CookBookFilter = ({
8082 display : 'inline-block' ,
8183 } }
8284 >
83- Category :
85+ { t ( 'category' ) } :
8486 </ Box > { ' ' }
8587 { categories [ selectedCategory ] }
8688 </ ActionMenu . Button >
@@ -107,7 +109,7 @@ export const CookBookFilter = ({
107109 display : 'inline-block' ,
108110 } }
109111 >
110- Complexity :
112+ { t ( 'complexity' ) } :
111113 </ Box > { ' ' }
112114 { complexities [ selectedComplexity ] }
113115 </ ActionMenu . Button >
@@ -127,7 +129,7 @@ export const CookBookFilter = ({
127129 </ ActionMenu >
128130
129131 < Button variant = "invisible" className = "col-md-1 col-sm-2 mt-1" onClick = { onResetFilter } >
130- Reset filters
132+ { t ( 'reset_filters' ) }
131133 </ Button >
132134 </ div >
133135 </ div >
0 commit comments