Yattee v2 rewrite

This commit is contained in:
Arkadiusz Fal
2026-02-08 18:31:16 +01:00
parent 20d0cfc0c7
commit 05f921d605
1043 changed files with 163875 additions and 68430 deletions

View File

@@ -0,0 +1,62 @@
//
// ContinueWatchingGridCard.swift
// Yattee
//
// Grid card view for continue watching items.
//
import SwiftUI
struct TappableContinueWatchingGridCard: View {
let entry: WatchEntry
let onRemove: () -> Void
private var video: Video {
entry.toVideo()
}
var body: some View {
ContinueWatchingGridCard(entry: entry)
.tappableVideo(
video,
startTime: entry.watchedSeconds,
queueSource: .manual,
sourceLabel: String(localized: "queue.source.continueWatching")
)
.videoContextMenu(
video: video,
customActions: [
VideoContextAction(
String(localized: "continueWatching.remove"),
systemImage: "xmark.circle",
role: .destructive,
action: onRemove
)
],
context: .continueWatching,
startTime: entry.watchedSeconds
)
}
}
/// Grid card for continue watching items with automatic DeArrow support.
struct ContinueWatchingGridCard: View {
let entry: WatchEntry
private var video: Video {
entry.toVideo()
}
var body: some View {
VideoCardView(
video: video,
watchProgress: entry.progress,
customMetadata: entry.isFinished ? nil : String(localized: "home.history.remaining \(entry.remainingTime)"),
customDuration: entry.remainingTime
)
}
}
// MARK: - Preview
// Note: Preview requires a WatchEntry object from SwiftData context.
// See ContinueWatchingView.swift for usage examples.