* Migrate all files from UserDashboard to AdminDashboard. Rename accordingly since this is an admin only function. Move all AdminDashboard items from SettingsCoordinator to their own AdminDashboardCoordinator. Move all ViewModels to ONLY live inside of the iOS build since tvOS is * cleanup * fix for sub navigation --------- Co-authored-by: Ethan Pippin <ethanpippin2343@gmail.com>
45 lines
1.0 KiB
Swift
45 lines
1.0 KiB
Swift
//
|
|
// Swiftfin is subject to the terms of the Mozilla Public
|
|
// License, v2.0. If a copy of the MPL was not distributed with this
|
|
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
|
//
|
|
// Copyright (c) 2024 Jellyfin & Jellyfin Contributors
|
|
//
|
|
|
|
import Defaults
|
|
import JellyfinAPI
|
|
import SwiftUI
|
|
|
|
struct ServerUserDetailsView: View {
|
|
|
|
@EnvironmentObject
|
|
private var router: AdminDashboardCoordinator.Router
|
|
|
|
@CurrentDate
|
|
private var currentDate: Date
|
|
|
|
@StateObject
|
|
private var viewModel: ServerUserAdminViewModel
|
|
|
|
// MARK: - Initializer
|
|
|
|
init(user: UserDto) {
|
|
_viewModel = StateObject(wrappedValue: ServerUserAdminViewModel(user: user))
|
|
}
|
|
|
|
// MARK: - Body
|
|
|
|
var body: some View {
|
|
List {
|
|
AdminDashboardView.UserSection(
|
|
user: viewModel.user,
|
|
lastActivityDate: viewModel.user.lastActivityDate
|
|
)
|
|
}
|
|
.navigationTitle(L10n.user)
|
|
.onAppear {
|
|
viewModel.send(.loadDetails)
|
|
}
|
|
}
|
|
}
|