Ferrite-backup/Ferrite/Views/ComponentViews/SearchResult/SearchResultInfoView.swift
kingbri 5120b3e576 Debrid: Migrate more components to the protocol
Protocols can't be used in ObservedObjects. Observable in iOS 17
and up solves this, but Ferrite targets iOS 16 and up, so add a
type-erased StateObject which supports protocols.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00

39 lines
824 B
Swift

//
// SearchResultRDView.swift
// Ferrite
//
// Created by Brian Dashore on 7/26/22.
//
import SwiftUI
struct SearchResultInfoView: View {
@EnvironmentObject var debridManager: DebridManager
var result: SearchResult
var body: some View {
HStack {
Text(result.source)
Spacer()
if let seeders = result.seeders {
Text("S: \(seeders)")
}
if let leechers = result.leechers {
Text("L: \(leechers)")
}
if let size = result.size {
Text(size)
}
if let debridSource = debridManager.debridSourceFromName() {
DebridLabelView(debridSource: debridSource, magnet: result.magnet)
}
}
.font(.caption)
}
}