Files
Archive/sing-box/clients/apple/ApplicationLibrary/Views/Abstract/NavigationSheetContent.swift
T
2026-01-28 19:49:38 +01:00

49 lines
1.0 KiB
Swift

import Library
import SwiftUI
@MainActor
public struct SheetContent<Content: View>: View {
private let title: String
private let content: Content
public init(_ title: String, @ViewBuilder content: () -> Content) {
self.title = title
self.content = content()
}
public var body: some View {
#if os(iOS) || os(tvOS)
NavigationStackCompat {
content
.navigationTitle(title)
#if os(iOS)
.navigationBarTitleDisplayMode(.inline)
#endif
}
.presentationDetentsIfAvailable()
#endif
}
}
@MainActor
public struct GroupsSheetContent: View {
public init() {}
public var body: some View {
SheetContent("Groups") {
GroupListView()
}
}
}
@MainActor
public struct ConnectionsSheetContent: View {
public init() {}
public var body: some View {
SheetContent("Connections") {
ConnectionListView()
}
}
}