Files
2023-01-11 17:55:35 -05:00

48 lines
1.1 KiB
Swift
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// The MIT License (MIT)
//
// Copyright (c) 2020–2023 Alexander Grebenyuk (github.com/kean).
import SwiftUI
import Pulse
struct NetworkMenuCell: View {
let icon: String
let tintColor: Color
let title: String
var details: String = ""
var body: some View {
#if os(watchOS)
HStack {
HStack {
Text(title)
Spacer()
Text(details).foregroundColor(.secondary)
}
}
#elseif os(tvOS)
HStack {
Label(title, systemImage: icon)
Spacer()
Text(details).foregroundColor(.secondary)
}
#elseif os(macOS)
HStack {
Label(title, systemImage: icon)
Spacer()
Text(details).foregroundColor(.secondary)
}.padding(.vertical, 1)
#else
HStack {
Image(systemName: icon)
.foregroundColor(tintColor)
.font(.system(size: 20))
.frame(width: 27, alignment: .center)
Text(title)
Spacer()
Text(details).foregroundColor(.secondary)
}
#endif
}
}