@@ -15,14 +15,12 @@ import { ScrollArea, ScrollBar } from "@/components/ui/scroll-area";
15
15
import { userAtom } from "@/features/account/stores" ;
16
16
import { communityAtom } from "@/features/account/stores" ;
17
17
import { ButtonVariant , TagType } from "@/features/tags/types/tag" ;
18
- import { ScrollArea , ScrollBar } from "@/components/ui/scroll-area" ;
19
18
import { apiClient } from "@/utils/client" ;
20
19
import { useAtom } from "jotai" ;
21
20
import { useRouter } from "next/navigation" ;
22
21
import { useEffect , useRef , useState } from "react" ;
23
22
import { SearchBar } from "./SearchBar" ;
24
23
import style from "./style.module.scss" ;
25
- import { SearchBar } from "./SearchBar" ;
26
24
27
25
type TagCardProps = {
28
26
type : "user" | "community" ;
@@ -44,7 +42,8 @@ export const TagCard = ({ type }: TagCardProps) => {
44
42
const totalSelectedTags = new Set ( [ ...selectedRegularTags , ...selectedAiTags ] ) ;
45
43
46
44
const filteredTags = tags . filter ( tag =>
47
- tag . name . toLowerCase ( ) . includes ( searchQuery . toLowerCase ( ) )
45
+ tag . name . toLowerCase ( ) . includes ( searchQuery . toLowerCase ( ) ) ,
46
+ ) ;
48
47
49
48
useEffect ( ( ) => {
50
49
console . log ( "aiRecommendedTags updated:" , aiRecommendedTags ) ;
@@ -136,7 +135,7 @@ export const TagCard = ({ type }: TagCardProps) => {
136
135
} ;
137
136
} , [ type , currentUser ?. uuid , currentCommunity ?. uuid ] ) ;
138
137
139
- const handleTagClick = ( index : number , isAiTag : boolean = false ) => {
138
+ const handleTagClick = ( index : number , isAiTag = false ) => {
140
139
if ( isAiTag ) {
141
140
const aiTag = aiRecommendedTags [ index ] ;
142
141
const regularTagIndex = tags . findIndex ( tag => tag . name === aiTag . name ) ;
@@ -161,7 +160,6 @@ export const TagCard = ({ type }: TagCardProps) => {
161
160
return newRegularSet ;
162
161
} ) ;
163
162
}
164
-
165
163
}
166
164
return newSet ;
167
165
} ) ;
@@ -213,7 +211,7 @@ export const TagCard = ({ type }: TagCardProps) => {
213
211
214
212
const selectedTagNames = [
215
213
...Array . from ( selectedRegularTags ) . map ( index => tags [ index ] ?. name ) ,
216
- ...Array . from ( selectedAiTags ) . map ( index => aiRecommendedTags [ index ] ?. name )
214
+ ...Array . from ( selectedAiTags ) . map ( index => aiRecommendedTags [ index ] ?. name ) ,
217
215
] . filter ( Boolean ) ;
218
216
219
217
try {
@@ -243,10 +241,7 @@ export const TagCard = ({ type }: TagCardProps) => {
243
241
</ CardDescription >
244
242
</ CardHeader >
245
243
< CardContent >
246
- < SearchBar
247
- searchQuery = { searchQuery }
248
- setSearchQuery = { setSearchQuery }
249
- />
244
+ < SearchBar searchQuery = { searchQuery } setSearchQuery = { setSearchQuery } />
250
245
< ScrollArea className = "w-full h-[120px] whitespace-nowrap rounded-md border" >
251
246
< div className = { style . tagContainer } >
252
247
{ filteredTags . map ( ( tag , index ) => (
0 commit comments