@@ -20,6 +20,7 @@ interface InputSearchFieldProps {
20
20
selectedData : Option [ ] ;
21
21
searchValue : string ;
22
22
setSearchValue : ( value : string ) => void ;
23
+ iconComponent ?: React . ReactElement ;
23
24
}
24
25
25
26
const InputSearchField : React . FC < InputSearchFieldProps > = ( {
@@ -32,7 +33,8 @@ const InputSearchField: React.FC<InputSearchFieldProps> = ({
32
33
disabled,
33
34
selectedData,
34
35
searchValue,
35
- setSearchValue
36
+ setSearchValue,
37
+ iconComponent = ( < OrgIcon { ...iconLarge } /> ) as React . ReactElement
36
38
} ) => {
37
39
const [ error , setError ] = useState ( '' ) ;
38
40
const [ open , setOpen ] = useState ( false ) ;
@@ -140,9 +142,7 @@ const InputSearchField: React.FC<InputSearchFieldProps> = ({
140
142
< Box component = "li" sx = { { '& > img' : { mr : 2 , flexShrink : 0 } } } >
141
143
< Grid container alignItems = "center" >
142
144
< Grid item >
143
- < Box sx = { { color : 'text.secondary' , mr : 2 } } >
144
- < OrgIcon { ...iconLarge } />
145
- </ Box >
145
+ < Box sx = { { color : 'text.secondary' , mr : 2 } } > { iconComponent } </ Box >
146
146
</ Grid >
147
147
< Grid item xs >
148
148
< Typography variant = "body2" > { option . name } </ Typography >
@@ -164,7 +164,7 @@ const InputSearchField: React.FC<InputSearchFieldProps> = ({
164
164
{ ! showAllItems && localSelectedData ?. length > 0 && (
165
165
< Chip
166
166
key = { localSelectedData [ localSelectedData . length - 1 ] ?. id }
167
- avatar = { < OrgIcon { ... iconSmall } /> }
167
+ avatar = { iconComponent }
168
168
label = { localSelectedData [ localSelectedData . length - 1 ] ?. name }
169
169
size = "small"
170
170
onDelete = { ( ) => handleDelete ( localSelectedData [ localSelectedData . length - 1 ] ?. id ) }
0 commit comments