Repository: strapi/strapi
File: packages/core/upload/admin/src/components/FilterList/index.jsx (JavaScript)

Code before:
      const value = decodeURIComponent(filter[name][filterType]);

      return prevFilter[name]?.[filterType] !== value;
    });

    onRemoveFilter(nextFilters);
  };

  return appliedFilters.map((filter, i) => {
    const attributeName = Object.keys(filter)[0];
    const attribute = filtersSchema.find(({ name }) => name === attributeName);

    const filterObj = filter[attributeName];
    const operator = Object.keys(filterObj)[0];
    let value = filterObj[operator];

    if (Array.isArray(value)) {
      value = value.join(', ');
    } else if (typeof value === 'object') {
      value = Object.values(value).join(', ');
    } else {
      value = decodeURIComponent(value);
    }

    let displayedOperator = operator;

    if (attribute.name === 'mime') {
      displayedOperator = operator === '$contains' ? '$eq' : '$ne';

      // Type is file
      // The filter for the file is the following: { mime: {$not: {$contains: ['image', 'video']}}}
      if (operator === '$not') {
        value = 'file';
        displayedOperator = '$eq';
      }

      // Here the type is file and the filter is not file
      // { mime: {$contains: ['image', 'video'] }}
      if (['image', 'video'].includes(value[0]) && ['image', 'video'].includes(value[1])) {
        value = 'file';
        displayedOperator = '$ne';
      }
    }

    return (
      <FilterTag
        // eslint-disable-next-line react/no-array-index-key
        key={`${attributeName}-${i}`}
        attribute={attribute}
        filter={filter}
        onClick={handleClick}

Review comment (suggestion):
```suggestion
    value = Array.isArray(value) || typeof value === 'object'
      ? Object.values(value).join(', ')
      : decodeURIComponent(value);
```

Code after:
      const value = decodeURIComponent(filter[name][filterType]);

      return prevFilter[name]?.[filterType] !== value;
    });

    onRemoveFilter(nextFilters);
  };

  return appliedFilters.map((filter, i) => {
    const attributeName = Object.keys(filter)[0];
    const attribute = filtersSchema.find(({ name }) => name === attributeName);

    const filterObj = filter[attributeName];
    const operator = Object.keys(filterObj)[0];
    let value = filterObj[operator];

    if (Array.isArray(value)) {
      value = value.join(', ');
    } else if (typeof value === 'object') {
      value = Object.values(value).join(', ');
    } else {
      value =
        Array.isArray(value) || typeof value === 'object'
          ? Object.values(value).join(', ')
          : decodeURIComponent(value);
    }

    let displayedOperator = operator;

    if (attribute.name === 'mime') {
      displayedOperator = operator === '$contains' ? '$eq' : '$ne';

      // Type is file
      // The filter for the file is the following: { mime: {$not: {$contains: ['image', 'video']}}}
      if (operator === '$not') {
        value = 'file';
        displayedOperator = '$eq';
      }

      // Here the type is file and the filter is not file
      // { mime: {$contains: ['image', 'video'] }}
      if (['image', 'video'].includes(value[0]) && ['image', 'video'].includes(value[1])) {
        value = 'file';
        displayedOperator = '$ne';
      }
    }

    return (
      <FilterTag
        // eslint-disable-next-line react/no-array-index-key
        key={`${attributeName}-${i}`}