Skip to content

Commit 48ac235

Browse files
committed
fix(icon): make filter icon custom
Signed-off-by: Sudhanshu Dasgupta <[email protected]>
1 parent a32ee32 commit 48ac235

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/custom/InputSearchField/InputSearchField.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ interface InputSearchFieldProps {
2020
selectedData: Option[];
2121
searchValue: string;
2222
setSearchValue: (value: string) => void;
23+
iconComponent?: React.ReactElement;
2324
}
2425

2526
const 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

Comments
 (0)