Ferrite-backup/Ferrite/Views/ComponentViews/Plugin/Buttons/SourceCatalogButtonView.swift
kingbri 4512318e8f Ferrite: Add actions, plugins, and tags
Plugins are now a unified format for both sources and actions. Actions
dictate what to do with a link and can now be added through a plugin
JSON file.

Backups have also been versioned to improve performance and add action
support.

Tags are used to give small amounts of information before a user
installs a plugin.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-02-08 12:09:37 -05:00

38 lines
913 B
Swift

//
// SourceCatalogButtonView.swift
// Ferrite
//
// Created by Brian Dashore on 8/5/22.
//
import SwiftUI
struct SourceCatalogButtonView: View {
@EnvironmentObject var pluginManager: PluginManager
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 pluginManager.installSource(sourceJson: availableSource)
}
}
}
.padding(.vertical, 2)
}
}