feat(Content, ProductDetail, SearchBar): enhance product handling with translation support
- Updated Content component to process products using translated attributes, improving localization. - Modified ProductDetailPage to utilize translatedProduct for similar products. - Adjusted SearchBar to provide suggestions based on translated products, enhancing user experience across components.
This commit is contained in:
@@ -79,7 +79,7 @@ const SearchBar = () => {
|
||||
(response) => {
|
||||
if (response && response.products) {
|
||||
// getSearchProducts returns response.products array
|
||||
const suggestions = response.products.slice(0, 8); // Limit to 8 suggestions
|
||||
const suggestions = response.products.map(p => p.translatedProduct || p).slice(0, 8); // Limit to 8 suggestions
|
||||
setSuggestions(suggestions);
|
||||
setShowSuggestions(suggestions.length > 0);
|
||||
setSelectedIndex(-1); // Reset selection
|
||||
|
||||
Reference in New Issue
Block a user