ChWebsiteApp/CHDataManagement/Views/Pages/Commands/InsertableItemsView.swift
2025-01-24 22:47:54 +01:00

30 lines
628 B
Swift

import SwiftUI
import SFSafeSymbols
private struct InsertableView<Command>: View where Command: InsertableCommand {
@State
private var showSheet: Bool = false
var body: some View {
Button(action: { showSheet = true }) {
Label(Command.title, systemSymbol: Command.icon)
}
.sheet(isPresented: $showSheet) {
InsertableCommandSheet<Command>()
}
}
}
struct InsertableItemsView: View {
var body: some View {
HStack {
Text("Commands")
.font(.headline)
InsertableView<InsertableImage>()
}
}
}