Ferrite-backup/Ferrite/Views/SourceViews/SourceCatalogView.swift
kingbri bb481f471e Ferrite: Format
Signed-off-by: kingbri <bdashore3@gmail.com>
2022-08-31 00:41:38 -04:00

35 lines
831 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") {
sourceManager.installSource(sourceJson: availableSource)
}
}
}
}