in src/application/ui/src/components/AIFilterSuggestion.js [355:372]
isAvailable: hasAvailableOptions(question.filterType, question.baseOptions),
index
})).filter(q => q.isAvailable);
}, [questions, hasAvailableOptions]);
// Find the next available question index - now memoized
const findNextAvailableQuestion = useCallback((startIndex) => {
const nextQuestion = availableQuestions.find(q => q.index > startIndex);
return nextQuestion ? nextQuestion.index : -1;
}, [availableQuestions]);
// Handle option selection
const handleOptionClick = useCallback((filterId, value) => {
// Apply the filter
onFilterChange(filterId, value, true);
// Record this action in history
setFilterHistory(prev => [...prev, {