diff --git a/src/recommendations/ProductCard/BaseCard/index.jsx b/src/recommendations/ProductCard/BaseCard/index.jsx index 8a8f0b76..ff5475fc 100644 --- a/src/recommendations/ProductCard/BaseCard/index.jsx +++ b/src/recommendations/ProductCard/BaseCard/index.jsx @@ -39,8 +39,8 @@ const BaseCard = ({ />
diff --git a/src/recommendations/data/utils.js b/src/recommendations/data/utils.js index 0fe0e741..4b414f21 100644 --- a/src/recommendations/data/utils.js +++ b/src/recommendations/data/utils.js @@ -47,7 +47,9 @@ export const getVariant = (productType) => ( export const createCodeFriendlyProduct = (type) => type?.replace(/\s+/g, '-').replace(/'/g, '').toLowerCase(); -export const truncateText = (input) => (input?.length > 50 ? `${input.substring(0, 50)}...` : input); +export const truncateText = (input, textLength) => ( + input?.length > textLength ? `${input.substring(0, textLength)}...` : input +); export const filterLocationRestriction = (products, countryCode) => products.filter((product) => { if (product.locationRestriction) {