Skip to content

Commit

Permalink
Merge pull request #802 from sudhanshutech/icon/filter
Browse files Browse the repository at this point in the history
 make filter icon custom
  • Loading branch information
sudhanshutech authored Nov 11, 2024
2 parents a32ee32 + 48ac235 commit 86592ac
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/custom/InputSearchField/InputSearchField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ interface InputSearchFieldProps {
selectedData: Option[];
searchValue: string;
setSearchValue: (value: string) => void;
iconComponent?: React.ReactElement;
}

const InputSearchField: React.FC<InputSearchFieldProps> = ({
Expand All @@ -32,7 +33,8 @@ const InputSearchField: React.FC<InputSearchFieldProps> = ({
disabled,
selectedData,
searchValue,
setSearchValue
setSearchValue,
iconComponent = (<OrgIcon {...iconLarge} />) as React.ReactElement
}) => {
const [error, setError] = useState('');
const [open, setOpen] = useState(false);
Expand Down Expand Up @@ -140,9 +142,7 @@ const InputSearchField: React.FC<InputSearchFieldProps> = ({
<Box component="li" sx={{ '& > img': { mr: 2, flexShrink: 0 } }}>
<Grid container alignItems="center">
<Grid item>
<Box sx={{ color: 'text.secondary', mr: 2 }}>
<OrgIcon {...iconLarge} />
</Box>
<Box sx={{ color: 'text.secondary', mr: 2 }}>{iconComponent}</Box>
</Grid>
<Grid item xs>
<Typography variant="body2">{option.name}</Typography>
Expand All @@ -164,7 +164,7 @@ const InputSearchField: React.FC<InputSearchFieldProps> = ({
{!showAllItems && localSelectedData?.length > 0 && (
<Chip
key={localSelectedData[localSelectedData.length - 1]?.id}
avatar={<OrgIcon {...iconSmall} />}
avatar={iconComponent}
label={localSelectedData[localSelectedData.length - 1]?.name}
size="small"
onDelete={() => handleDelete(localSelectedData[localSelectedData.length - 1]?.id)}
Expand Down

0 comments on commit 86592ac

Please sign in to comment.