export const formatFilterDisplayName = (displayName: string) => {
  const sizes = ['xxxs', 'xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl', 'xxxl', 'xxxxl'];

  const processedWords = displayName
    .toLowerCase()
    .split(' ')
    .map(word => {
      if (sizes.includes(word)) {
        return word.toUpperCase();
      }
      return word.charAt(0).toUpperCase() + word.slice(1);
    });

  const titleCasedName = processedWords.join(' ');

  // Final replacements for special cases
  return titleCasedName.replace(/Iphone/g, 'iPhone');
};
