@@ -170,33 +170,70 @@ export const TagsComponent: FC<{
170
170
selected = { tagValue }
171
171
onAdd = { onAddition }
172
172
onInput = { setSuggestions }
173
+ renderOption = { ( option ) => {
174
+ const findTag = data ?. tags ?. find (
175
+ ( f ) => f . name === option . option . label
176
+ ) ;
177
+ return (
178
+ < div
179
+ className = "flex flex-row items-center gap-2 p-2 cursor-pointer hover:bg-customColor1 "
180
+ { ...option }
181
+ >
182
+ < input
183
+ type = "checkbox"
184
+ checked = {
185
+ tagValue . findIndex ( ( f ) => f . label === option . option . label ) >
186
+ - 1
187
+ }
188
+ readOnly
189
+ />
190
+ < div
191
+ className = "size-3 rounded-full flex-shrink-0"
192
+ style = { {
193
+ backgroundColor : findTag ?. color || '#942828' ,
194
+ } }
195
+ />
196
+ { option . option . label }
197
+ { /* edit and delete butotns */ }
198
+ < div className = "flex items-center flex-grow flex-row-reverse" >
199
+ { findTag && (
200
+ < Button
201
+ onClick = { edit ( findTag ) }
202
+ className = "!h-6 !px-2 !rounded !text-xs !bg-third items-center hover:!opacity-70"
203
+ >
204
+ < svg
205
+ xmlns = "http://www.w3.org/2000/svg"
206
+ fill = "none"
207
+ viewBox = "0 0 24 24"
208
+ strokeWidth = { 1.5 }
209
+ stroke = "currentColor"
210
+ className = "w-3 h-3"
211
+ >
212
+ < path
213
+ strokeLinecap = "round"
214
+ strokeLinejoin = "round"
215
+ d = "M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L6.832 19.82a4.5 4.5 0 01-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 011.13-1.897L16.863 4.487zm0 0L19.5 7.125"
216
+ />
217
+ </ svg >
218
+ { t ( 'edit' , 'Edit' ) }
219
+ </ Button >
220
+ ) }
221
+ </ div >
222
+ </ div >
223
+ ) ;
224
+ } }
173
225
onDelete = { onDelete }
174
226
renderTag = { ( tag ) => {
175
227
const findTag = data ?. tags ?. find ( ( f ) => f . name === tag . tag . label ) ;
176
- const findIndex = tagValue . findIndex (
177
- ( f ) => f . label === tag . tag . label
178
- ) ;
179
228
return (
180
229
< div
181
- className = { `min-w-[50px] float-left ms-[4px] p-[3px] rounded-sm relative` }
230
+ className = { `min-w-[50px] float-left ms-[4px] p-[3px] rounded-lg relative cursor-pointer text-[12px] flex items-center justify-center tag-item ` }
182
231
style = { {
183
232
backgroundColor : findTag ?. color ,
184
233
} }
185
234
>
186
- < div
187
- className = "absolute -top-[5px] start-[10px] text-[12px] text-red-600 bg-white px-[3px] rounded-full"
188
- onClick = { edit ( findTag ) }
189
- >
190
- { t ( 'edit' , 'Edit' ) }
191
- </ div >
192
- < div
193
- className = "absolute -top-[5px] -start-[5px] text-[12px] text-red-600 bg-white px-[3px] rounded-full"
194
- onClick = { ( ) => onDelete ( findIndex ) }
195
- >
196
- X
197
- </ div >
198
235
< div className = "text-white mix-blend-difference" >
199
- { tag . tag . label }
236
+ { findTag . name }
200
237
</ div >
201
238
</ div >
202
239
) ;
@@ -206,6 +243,7 @@ export const TagsComponent: FC<{
206
243
</ >
207
244
) ;
208
245
} ;
246
+
209
247
const ShowModal : FC < {
210
248
tag : string ;
211
249
color ?: string ;
0 commit comments