diff --git a/components/searchBar/SearchBar.language.json b/components/searchBar/SearchBar.language.json new file mode 100644 index 0000000..c5d3be0 --- /dev/null +++ b/components/searchBar/SearchBar.language.json @@ -0,0 +1,3 @@ +{ + "searchBarPlaceholder": "Search" +} diff --git a/components/searchBar/SearchBar.tsx b/components/searchBar/SearchBar.tsx index fee603f..f42de20 100644 --- a/components/searchBar/SearchBar.tsx +++ b/components/searchBar/SearchBar.tsx @@ -1,4 +1,6 @@ import React, { useCallback, ReactElement } from 'react'; +import { useTranslator } from '../language/useTranslator'; +import languageFile from './SearchBar.language.json'; import styles from './SearchBar.module.scss'; interface Props { @@ -16,6 +18,7 @@ const debounce = (callback, delay) => { const SearchBar = (props: Props): ReactElement => { const { handelSearch, placeholder } = props; + const searchPlaceholder = useTranslator('searchBarPlaceholder', languageFile); const debounceHandler = useCallback(debounce(handelSearch, 1000), []); @@ -29,7 +32,7 @@ const SearchBar = (props: Props): ReactElement => {