mirror of
https://github.com/yJason/ClashX-Dashboard.git
synced 2026-03-01 00:35:19 +08:00
fix: spm
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// ConfigItemView.swift
|
||||
// ClashX Dashboard
|
||||
//
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct ConfigItemView<Content: View>: View {
|
||||
|
||||
@State var name: String
|
||||
var content: () -> Content
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
HStack {
|
||||
Text(name)
|
||||
.font(.subheadline)
|
||||
.foregroundColor(.secondary)
|
||||
Spacer()
|
||||
}
|
||||
HStack(content: content)
|
||||
}
|
||||
.padding(EdgeInsets(top: 10, leading: 13, bottom: 10, trailing: 13))
|
||||
.background(Color(nsColor: .textBackgroundColor))
|
||||
.cornerRadius(10)
|
||||
}
|
||||
}
|
||||
|
||||
struct ConfigItemView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
ConfigItemView(name: "test") {
|
||||
Text("label")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user