1 import type { Filter } from '@proton/components/containers/filters/interfaces';
2 import { FILTER_STATUS, FREE_USER_ACTIVE_FILTERS_LIMIT } from '@proton/shared/lib/constants';
3 import type { UserModel } from '@proton/shared/lib/interfaces';
5 export const hasReachedFiltersLimit = (user: UserModel, userFilters: Filter[]) => {
6 const { hasPaidMail } = user;
8 const enabledFilters = userFilters.filter((filter) => filter.Status === FILTER_STATUS.ENABLED);
10 return !hasPaidMail && enabledFilters.length >= FREE_USER_ACTIVE_FILTERS_LIMIT;