@@ -20,6 +20,7 @@ interface InputSearchFieldProps {
2020 selectedData : Option [ ] ;
2121 searchValue : string ;
2222 setSearchValue : ( value : string ) => void ;
23+ iconComponent ?: React . ReactElement ;
2324}
2425
2526const InputSearchField : React . FC < InputSearchFieldProps > = ( {
@@ -32,7 +33,8 @@ const InputSearchField: React.FC<InputSearchFieldProps> = ({
3233 disabled,
3334 selectedData,
3435 searchValue,
35- setSearchValue
36+ setSearchValue,
37+ iconComponent = ( < OrgIcon { ...iconLarge } /> ) as React . ReactElement
3638} ) => {
3739 const [ error , setError ] = useState ( '' ) ;
3840 const [ open , setOpen ] = useState ( false ) ;
@@ -140,9 +142,7 @@ const InputSearchField: React.FC<InputSearchFieldProps> = ({
140142 < Box component = "li" sx = { { '& > img' : { mr : 2 , flexShrink : 0 } } } >
141143 < Grid container alignItems = "center" >
142144 < 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 >
146146 </ Grid >
147147 < Grid item xs >
148148 < Typography variant = "body2" > { option . name } </ Typography >
@@ -164,7 +164,7 @@ const InputSearchField: React.FC<InputSearchFieldProps> = ({
164164 { ! showAllItems && localSelectedData ?. length > 0 && (
165165 < Chip
166166 key = { localSelectedData [ localSelectedData . length - 1 ] ?. id }
167- avatar = { < OrgIcon { ... iconSmall } /> }
167+ avatar = { iconComponent }
168168 label = { localSelectedData [ localSelectedData . length - 1 ] ?. name }
169169 size = "small"
170170 onDelete = { ( ) => handleDelete ( localSelectedData [ localSelectedData . length - 1 ] ?. id ) }
0 commit comments