summaryrefslogtreecommitdiff
path: root/Jel/Views/Dashboard/Library/LibraryIconView.swift
diff options
context:
space:
mode:
authorShav Kinderlehrer <[email protected]>2023-12-22 17:14:21 -0500
committerShav Kinderlehrer <[email protected]>2023-12-22 17:14:21 -0500
commit5b78933de774fcf9291ba40e74dd928925699b0c (patch)
treeea256f35be0d2ef158306cd9a5dad1c72b4d6efd /Jel/Views/Dashboard/Library/LibraryIconView.swift
parent62a8e5704edb604d41af34df7607adf6492ca855 (diff)
downloadjel-5b78933de774fcf9291ba40e74dd928925699b0c.tar.gz
jel-5b78933de774fcf9291ba40e74dd928925699b0c.zip
Start implementing dashboard view + async image loader
Diffstat (limited to 'Jel/Views/Dashboard/Library/LibraryIconView.swift')
-rw-r--r--Jel/Views/Dashboard/Library/LibraryIconView.swift22
1 files changed, 19 insertions, 3 deletions
diff --git a/Jel/Views/Dashboard/Library/LibraryIconView.swift b/Jel/Views/Dashboard/Library/LibraryIconView.swift
index 4f6c711..c4dbde0 100644
--- a/Jel/Views/Dashboard/Library/LibraryIconView.swift
+++ b/Jel/Views/Dashboard/Library/LibraryIconView.swift
@@ -6,13 +6,29 @@
//
import SwiftUI
+import JellyfinKit
+import BlurHashKit
struct LibraryIconView: View {
- var body: some View {
- Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/)
+ @EnvironmentObject var jellyfinClient: JellyfinClientController
+
+ @State var library: BaseItemDto
+ @State var loadingImage: Bool = true
+
+ @State var loadedImageBinaryData: Data?
+
+ var body: some View {
+ VStack {
+ AsyncImageView(imageId: library.id ?? "",
+ blurhash: library.imageBlurHashes?.primary?[library.imageTags?["Primary"] ?? ""] ?? "",
+ imageType: "Primary")
+
+ Text(library.name ?? "Unknown")
+ .font(.subheadline)
}
+ }
}
#Preview {
- LibraryIconView()
+ LibraryIconView(library: BaseItemDto())
}