private fun filterItems( searchedForText: String?, sortingStrategy: SortingStrategy, state: LoginsListState, ): LoginsListState { return if (searchedForText.isNullOrBlank()) { state.copy( isLoading = false, sortingStrategy = sortingStrategy, highlightedItem = sortingStrategyToMenuItem(sortingStrategy), searchedForText = searchedForText, filteredItems = sortingStrategy(state.loginList), ) } else { state.copy( isLoading = false, sortingStrategy = sortingStrategy, highlightedItem = sortingStrategyToMenuItem(sortingStrategy), searchedForText = searchedForText, filteredItems = sortingStrategy(state.loginList).filter { it.origin.contains( searchedForText, ) }, ) } }
 [LoginsListState] containing a new [LoginsListState.filteredItems] with filtered [LoginsListState.items]