mirror of
https://github.com/kean/Pulse.git
synced 2026-05-30 21:07:33 +00:00
48 lines
1.1 KiB
Swift
48 lines
1.1 KiB
Swift
// The MIT License (MIT)
|
|
//
|
|
// Copyright (c) 2020-2024 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
|
|
}
|
|
}
|