mirror of
https://github.com/yattee/yattee.git
synced 2026-02-20 01:39:46 +00:00
Yattee v2 rewrite
This commit is contained in:
46
Yattee/Views/Home/PlaylistRowView.swift
Normal file
46
Yattee/Views/Home/PlaylistRowView.swift
Normal file
@@ -0,0 +1,46 @@
|
||||
//
|
||||
// PlaylistRowView.swift
|
||||
// Yattee
|
||||
//
|
||||
// Row view for displaying a playlist in lists.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import NukeUI
|
||||
|
||||
struct PlaylistRowView: View {
|
||||
let playlist: LocalPlaylist
|
||||
|
||||
var body: some View {
|
||||
HStack(spacing: 12) {
|
||||
// Thumbnail
|
||||
LazyImage(url: playlist.thumbnailURL) { state in
|
||||
if let image = state.image {
|
||||
image
|
||||
.resizable()
|
||||
.aspectRatio(contentMode: .fill)
|
||||
} else {
|
||||
Rectangle()
|
||||
.fill(.quaternary)
|
||||
.overlay {
|
||||
Image(systemName: "music.note.list")
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
}
|
||||
}
|
||||
.frame(width: 80, height: 45)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 6))
|
||||
|
||||
// Info
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
Text(playlist.title)
|
||||
.font(.headline)
|
||||
.lineLimit(1)
|
||||
|
||||
Text("\(playlist.videoCount) videos • \(playlist.formattedTotalDuration)")
|
||||
.font(.caption.monospacedDigit())
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user