Refactor SearchBarResultState.Initial and NoResultsFound to data objects

This commit is contained in:
ganfra
2026-07-23 16:15:02 +02:00
parent 075cca2d21
commit 9d427077f0
15 changed files with 38 additions and 54 deletions
@@ -65,8 +65,8 @@ class RoomSelectPresenter(
derivedStateOf {
when {
roomSummaryDetailsList.isNotEmpty() -> SearchBarResultState.Results(roomSummaryDetailsList.toImmutableList())
isSearchActive -> SearchBarResultState.NoResultsFound()
else -> SearchBarResultState.Initial()
isSearchActive -> SearchBarResultState.NoResultsFound
else -> SearchBarResultState.Initial
}
}
}
@@ -52,7 +52,7 @@ open class RoomSelectStateProvider : PreviewParameterProvider<RoomSelectState> {
internal fun aRoomSelectState(
mode: RoomSelectMode = RoomSelectMode.Forward,
maxNumberOfRooms: Int = 10,
resultState: SearchBarResultState<ImmutableList<SelectRoomInfo>> = SearchBarResultState.Initial(),
resultState: SearchBarResultState<ImmutableList<SelectRoomInfo>> = SearchBarResultState.Initial,
searchQuery: String = "",
isSearchActive: Boolean = false,
selectedRooms: ImmutableList<SelectRoomInfo> = persistentListOf(),