11'use client' ;
22
33import { useMemo , useState } from 'react' ;
4+ import { useTranslations } from 'next-intl' ;
45import BlogGrid from '@/components/blog/BlogGrid' ;
56
67type SocialLink = {
@@ -76,6 +77,7 @@ function SearchIcon({ className }: { className?: string }) {
7677}
7778
7879export default function BlogFilters ( { posts } : { posts : Post [ ] } ) {
80+ const t = useTranslations ( 'blog' ) ;
7981 const [ input , setInput ] = useState ( '' ) ;
8082 const [ selectedTags , setSelectedTags ] = useState < string [ ] > ( [ ] ) ;
8183
@@ -175,7 +177,7 @@ export default function BlogFilters({ posts }: { posts: Post[] }) {
175177 addTag ( input ) ;
176178 }
177179 } }
178- placeholder = "Пошук..."
180+ placeholder = { t ( 'searchPlaceholder' ) }
179181 className = "
180182 w-full
181183 rounded-xl
@@ -208,7 +210,7 @@ export default function BlogFilters({ posts }: { posts: Post[] }) {
208210 text-gray-600 hover:bg-gray-100
209211 transition
210212 "
211- title = "Remove tag"
213+ title = { t ( 'removeTag' ) }
212214 >
213215 < span > #{ tag } </ span >
214216 < span className = "text-base leading-none" > ×</ span >
@@ -225,7 +227,7 @@ export default function BlogFilters({ posts }: { posts: Post[] }) {
225227 hover:bg-gray-50 hover:border-gray-400 transition
226228 "
227229 >
228- Add
230+ { t ( 'add' ) }
229231 </ button >
230232 ) }
231233
@@ -239,7 +241,7 @@ export default function BlogFilters({ posts }: { posts: Post[] }) {
239241 hover:bg-gray-50 hover:border-gray-400 transition
240242 "
241243 >
242- Clear
244+ { t ( 'clear' ) }
243245 </ button >
244246 ) }
245247 </ div >
@@ -256,7 +258,7 @@ export default function BlogFilters({ posts }: { posts: Post[] }) {
256258
257259 { ! filteredPosts . length && (
258260 < p className = "text-center text-gray-500 mt-10" >
259- No posts found for selected tags.
261+ { t ( 'noPostsForTags' ) }
260262 </ p >
261263 ) }
262264 </ div >
0 commit comments