+
+ {selectedValues.slice(0, maxCount).map((value) => {
+ const option = options.find((o) => o.value === value);
+ const IconComponent = option?.icon;
+ return (
+
+ {IconComponent && (
+
+ )}
+ {option?.label}
+ {
+ event.stopPropagation();
+ toggleOption(value);
+ }}
+ />
+
+ );
+ })}
+ {selectedValues.length > maxCount && (
+
+ {`+ ${selectedValues.length - maxCount} more`}
+ {
+ event.stopPropagation();
+ clearExtraOptions();
+ }}
+ />
+
+ )}
+
+
+ {
+ event.stopPropagation();
+ handleClear();
+ }}
+ />
+
+
+
+
+ ) : (
+