- {option.description && option.description !== option.label ? (
-
+ {activeQuestion.options.map((option, index) => {
+ const isOptimisticallySelected =
+ optimisticSingleSelect?.questionId === activeQuestion.id &&
+ optimisticSingleSelect.optionLabel === option.label;
+ const isSelected =
+ isOptimisticallySelected ||
+ (!customAnswerActive && progress.selectedOptionLabels.includes(option.label));
+ const shortcutKey = index < 9 ? index + 1 : null;
+ const className = cn(
+ "group flex w-full items-center gap-2 rounded-md px-2.5 py-2 text-left outline-none transition-colors duration-150 focus-visible:ring-1 focus-visible:ring-primary/25",
+ isSelected
+ ? "bg-muted/55 text-foreground"
+ : "bg-transparent text-foreground/85 hover:bg-muted/30",
+ isResponding && "opacity-50 cursor-not-allowed",
+ !isResponding && "cursor-pointer",
+ );
+ const content = (
+ <>
+
+ {option.label}
+ {option.description && option.description !== option.label ? (
+
+ {option.description}
+
+ ) : null}
+
+ {isSelected ? (
+
+ ) : shortcutKey !== null ? (
+
+ {shortcutKey}
+
) : null}
-
- ) : null}
- >
- );
- return (
-