aboutsummaryrefslogtreecommitdiff
path: root/Hotline/macOS/Trackers/BonjourServerRow.swift
diff options
context:
space:
mode:
authorDustin Mierau <dustin@mierau.me>2025-11-07 21:03:53 -0800
committerDustin Mierau <dustin@mierau.me>2025-11-07 21:03:53 -0800
commit2f332ee497af925db1a2583135e9dfcdaff84794 (patch)
treeff22f357a87cfa9dd577b4273f7f62a89906d83b /Hotline/macOS/Trackers/BonjourServerRow.swift
parent637cd9af54a58db0c5dc2062b6c20291afd31147 (diff)
Add Bonjour discovery for Hotline servers on the local network to the Servers window.
Diffstat (limited to 'Hotline/macOS/Trackers/BonjourServerRow.swift')
-rw-r--r--Hotline/macOS/Trackers/BonjourServerRow.swift19
1 files changed, 19 insertions, 0 deletions
diff --git a/Hotline/macOS/Trackers/BonjourServerRow.swift b/Hotline/macOS/Trackers/BonjourServerRow.swift
new file mode 100644
index 0000000..d99b23b
--- /dev/null
+++ b/Hotline/macOS/Trackers/BonjourServerRow.swift
@@ -0,0 +1,19 @@
+import SwiftUI
+
+struct BonjourServerRow: View {
+ @Environment(\.openWindow) private var openWindow
+
+ let server: BonjourState.BonjourServer
+
+ var body: some View {
+ HStack(alignment: .center, spacing: 6) {
+ Image("Server")
+ .resizable()
+ .scaledToFit()
+ .frame(width: 16, height: 16, alignment: .center)
+ Text(self.server.displayName).lineLimit(1).truncationMode(.tail)
+ Spacer(minLength: 0)
+ }
+ .frame(maxWidth: .infinity, maxHeight: .infinity)
+ }
+}