Ferrite-backup/Ferrite/Views/SourceViews/Buttons/SourceCatalogButtonView.swift
kingbri a89e832d1c Ferrite: Concurrency, cleanup, and format
Use strict concurrency checking in Xcode 14 to find misuses with
Swift concurrency.

Cleanup files and rearrange them along with fixing comment headers.

Signed-off-by: kingbri <bdashore3@proton.me>
2022-10-05 10:48:02 -04:00

38 lines
913 B
Swift

//
// SourceCatalogButtonView.swift
// Ferrite
//
// Created by Brian Dashore on 8/5/22.
//
import SwiftUI
struct SourceCatalogButtonView: View {
@EnvironmentObject var sourceManager: SourceManager
let availableSource: SourceJson
var body: some View {
HStack {
VStack(alignment: .leading, spacing: 5) {
HStack {
Text(availableSource.name)
Text("v\(availableSource.version)")
.foregroundColor(.secondary)
}
Text("by \(availableSource.author ?? "Unknown")")
.foregroundColor(.secondary)
}
Spacer()
Button("Install") {
Task {
await sourceManager.installSource(sourceJson: availableSource)
}
}
}
.padding(.vertical, 2)
}
}