2022-09-30 13:34:41 +00:00
|
|
|
//
|
|
|
|
// Copyright 2021 New Vector Ltd
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
|
|
|
|
// MARK: - Coordinator
|
2022-10-07 09:58:26 +00:00
|
|
|
|
2022-10-04 06:38:53 +00:00
|
|
|
enum UserOtherSessionsCoordinatorResult {
|
2022-10-04 12:14:59 +00:00
|
|
|
case openSessionDetails(sessionInfo: UserSessionInfo)
|
2022-10-04 06:38:53 +00:00
|
|
|
}
|
2022-09-30 13:34:41 +00:00
|
|
|
|
|
|
|
// MARK: View model
|
|
|
|
|
2022-10-04 13:58:08 +00:00
|
|
|
enum UserOtherSessionsViewModelResult: Equatable {
|
2022-10-04 12:14:59 +00:00
|
|
|
case showUserSessionOverview(sessionInfo: UserSessionInfo)
|
2022-09-30 13:34:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// MARK: View
|
|
|
|
|
2022-10-04 13:58:08 +00:00
|
|
|
struct UserOtherSessionsViewState: BindableState, Equatable {
|
2022-10-11 05:42:28 +00:00
|
|
|
var bindings: UserOtherSessionsBindings
|
2022-09-30 13:34:41 +00:00
|
|
|
let title: String
|
|
|
|
var sections: [UserOtherSessionsSection]
|
|
|
|
}
|
|
|
|
|
2022-10-11 05:42:28 +00:00
|
|
|
struct UserOtherSessionsBindings: Equatable {
|
2022-10-12 06:30:41 +00:00
|
|
|
var filter: UserOtherSessionsFilter
|
2022-10-11 05:42:28 +00:00
|
|
|
}
|
|
|
|
|
2022-09-30 13:34:41 +00:00
|
|
|
enum UserOtherSessionsSection: Hashable, Identifiable {
|
|
|
|
var id: Self {
|
|
|
|
self
|
|
|
|
}
|
2022-10-07 09:58:26 +00:00
|
|
|
|
2022-09-30 13:34:41 +00:00
|
|
|
case sessionItems(header: UserOtherSessionsHeaderViewData, items: [UserSessionListItemViewData])
|
2022-10-11 11:54:09 +00:00
|
|
|
case emptySessionItems(header: UserOtherSessionsHeaderViewData, title: String)
|
2022-09-30 13:34:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
enum UserOtherSessionsViewAction {
|
2022-10-04 06:38:53 +00:00
|
|
|
case userOtherSessionSelected(sessionId: String)
|
2022-10-11 05:42:28 +00:00
|
|
|
case filerWasChanged
|
2022-10-11 11:54:09 +00:00
|
|
|
case clearFilter
|
2022-09-30 13:34:41 +00:00
|
|
|
}
|