Web:Common:Add icon in SelectedItem.

This commit is contained in:
Vlada Gazizova 2022-10-05 15:24:11 +03:00
parent 55e17eef42
commit ee43c167cc

View File

@ -32,16 +32,20 @@ const StyledSelectedItem = styled.div`
StyledSelectedItem.defaultProps = { theme: Base }; StyledSelectedItem.defaultProps = { theme: Base };
const SelectedItem = ({ propKey, label, group, removeSelectedItem }) => { const SelectedItem = ({ propKey, label, group, icon, removeSelectedItem }) => {
const onRemove = () => { const onRemove = () => {
removeSelectedItem(propKey, label, group); removeSelectedItem(propKey, label, group);
}; };
return ( return (
<StyledSelectedItem onClick={onRemove}> <StyledSelectedItem onClick={onRemove}>
{icon ? (
<img src={icon} />
) : (
<Text className={"selected-item_label"} title={label} noSelect> <Text className={"selected-item_label"} title={label} noSelect>
{label} {label}
</Text> </Text>
)}
<IconButton <IconButton
iconName={"/static/images/cross.react.svg"} iconName={"/static/images/cross.react.svg"}
size={12} size={12}