47 lines
1.4 KiB
Swift
47 lines
1.4 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 2021 Aiden Vigue & Jellyfin Contributors
|
|
*/
|
|
|
|
import JellyfinAPI
|
|
import SwiftUI
|
|
|
|
struct NextUpCard: View {
|
|
|
|
@EnvironmentObject var homeRouter: HomeCoordinator.Router
|
|
let item: BaseItemDto
|
|
|
|
var body: some View {
|
|
VStack(alignment: .leading) {
|
|
Button {
|
|
homeRouter.route(to: \.modalItem, item)
|
|
} label: {
|
|
ImageView(src: item.getBackdropImage(maxWidth: 500))
|
|
.frame(width: 500, height: 281.25)
|
|
}
|
|
.buttonStyle(CardButtonStyle())
|
|
.padding(.top)
|
|
|
|
VStack(alignment: .leading) {
|
|
Text("\(item.seriesName ?? item.name ?? "")")
|
|
.font(.callout)
|
|
.fontWeight(.semibold)
|
|
.foregroundColor(.primary)
|
|
.lineLimit(1)
|
|
|
|
if item.itemType == .episode {
|
|
Text(item.getEpisodeLocator() ?? "")
|
|
.font(.callout)
|
|
.fontWeight(.medium)
|
|
.foregroundColor(.secondary)
|
|
.lineLimit(1)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|