11import { useRouter } from 'next/navigation' ;
2- import { Card , Icon , PostUtil , Typography } from '@social/ui-shared' ;
2+ import { Card , PostUtil , Typography } from '@social/ui-shared' ;
33import { useEffect , useState } from 'react' ;
44import { twMerge } from 'tailwind-merge' ;
55import { useClientContext } from '../../contexts/client' ;
@@ -14,7 +14,7 @@ export default function SearchInputCard({
1414 ...rest
1515} : SearchInputCardProps ) {
1616 const router = useRouter ( ) ;
17- const { hotTags, searchTags , setSearchTags } = useClientContext ( ) ;
17+ const { hotTags } = useClientContext ( ) ;
1818 const [ loading , setLoading ] = useState ( true ) ;
1919
2020 useEffect ( ( ) => {
@@ -23,7 +23,8 @@ export default function SearchInputCard({
2323 }
2424 } , [ hotTags ] ) ;
2525
26- const handleTagSearch = ( tag : string ) => {
26+ {
27+ /** const handleTagSearch = (tag: string) => {
2728 if (searchTags.includes(tag)) return;
2829
2930 if (searchTags.length < 3) {
@@ -33,13 +34,16 @@ export default function SearchInputCard({
3334 setSearchTags(newSearchTags);
3435 }
3536 router.push('/search');
36- } ;
37+ };*/
38+ }
3739
38- const handleRemoveTag = ( indexToRemove : number ) => {
40+ {
41+ /** const handleRemoveTag = (indexToRemove: number) => {
3942 const newTags = [...searchTags];
4043 newTags.splice(indexToRemove, 1);
4144 setSearchTags(newTags);
42- } ;
45+ };*/
46+ }
4347
4448 return (
4549 < Card . Primary
@@ -49,7 +53,7 @@ export default function SearchInputCard({
4953 background = "bg-gradient-to-t from-[#07040a] to-[#1b1820]"
5054 >
5155 < div className = "flex-col gap-6 inline-flex" >
52- { searchTags . length > 0 && (
56+ { /**{ searchTags.length > 0 && (
5357 <div>
5458 <Typography.Label className="text-opacity-30">
5559 Searched tags
@@ -73,7 +77,7 @@ export default function SearchInputCard({
7377 ))}
7478 </div>
7579 </div>
76- ) }
80+ )}*/ }
7781 < div >
7882 < Typography . Label className = "text-opacity-30" >
7983 Hot tags
@@ -88,7 +92,7 @@ export default function SearchInputCard({
8892 < PostUtil . Tag
8993 key = { index }
9094 clicked = { false }
91- onClick = { ( ) => handleTagSearch ( tag . tag ) }
95+ onClick = { ( ) => router . push ( `/search?tags= ${ tag . tag } ` ) }
9296 color = "fuchsia"
9397 className = "mr-2 my-1"
9498 >
0 commit comments