diff --git a/src/custom/InputSearchField/InputSearchField.tsx b/src/custom/InputSearchField/InputSearchField.tsx index 1557e753..c6f9c647 100644 --- a/src/custom/InputSearchField/InputSearchField.tsx +++ b/src/custom/InputSearchField/InputSearchField.tsx @@ -20,6 +20,7 @@ interface InputSearchFieldProps { selectedData: Option[]; searchValue: string; setSearchValue: (value: string) => void; + iconComponent?: React.ReactElement; } const InputSearchField: React.FC = ({ @@ -32,7 +33,8 @@ const InputSearchField: React.FC = ({ disabled, selectedData, searchValue, - setSearchValue + setSearchValue, + iconComponent = () as React.ReactElement }) => { const [error, setError] = useState(''); const [open, setOpen] = useState(false); @@ -140,9 +142,7 @@ const InputSearchField: React.FC = ({ img': { mr: 2, flexShrink: 0 } }}> - - - + {iconComponent} {option.name} @@ -164,7 +164,7 @@ const InputSearchField: React.FC = ({ {!showAllItems && localSelectedData?.length > 0 && ( } + avatar={iconComponent} label={localSelectedData[localSelectedData.length - 1]?.name} size="small" onDelete={() => handleDelete(localSelectedData[localSelectedData.length - 1]?.id)}