onClick(option.value)
- }
- className={classes(
- "group flex cursor-pointer flex-col rounded duration-100",
- option.disabled && "opacity-muted cursor-not-allowed"
- )}
- >
- {option.image ? (
-

- ) : (
- hasImages && (
-
-
-
- )
- )}
-
- {option.name}
-
-
- ))}
+ : options.map(
+ (option, index) =>
+ ("component" in option && option.component(onClick)) || (
+ onClick(option.value)
+ }
+ className={classes(
+ "group relative flex cursor-pointer flex-col rounded duration-100",
+ option.disabled && "opacity-muted cursor-not-allowed"
+ )}
+ >
+ {option.onDelete && (
+
+ {
+ e.stopPropagation();
+ option.onDelete?.();
+ }}
+ className="group/delete pointer-events-none absolute -right-4 -top-4 h-fit w-fit scale-50 cursor-pointer rounded-xl bg-zinc-900 p-1 text-white/75 opacity-0 duration-150 ease-in-out hover:text-white group-hover:pointer-events-auto group-hover:-right-2 group-hover:-top-2 group-hover:scale-100 group-hover:opacity-100"
+ >
+
+
+
+ )}
+ {option.image ? (
+

+ ) : (
+ hasImages && (
+
+
+
+ )
+ )}
+
+ {"name" in option && option.name}
+
+
+ )
+ )}
);