This commit is contained in:
mrFq1
2023-06-05 23:39:23 +08:00
parent e5860ead2c
commit f488f41f8d
72 changed files with 247 additions and 45 deletions
@@ -0,0 +1,42 @@
//
// RuleProviderView.swift
// ClashX Dashboard
//
//
import SwiftUI
struct RuleProviderView: View {
@State var provider: DBRuleProvider
var body: some View {
VStack(alignment: .leading) {
HStack {
Text(provider.name)
.font(.title)
.fontWeight(.medium)
Text(provider.type)
Text(provider.behavior)
Spacer()
}
HStack {
Text("\(provider.ruleCount) rules")
if let date = provider.updatedAt {
Text("Updated \(RelativeDateTimeFormatter().localizedString(for: date, relativeTo: .now))")
}
Spacer()
}
.font(.system(size: 12))
.foregroundColor(.secondary)
}
}
}
//struct RuleProviderView_Previews: PreviewProvider {
// static var previews: some View {
// RuleProviderView()
// }
//}