Files
Kisani/Shared/Components/UGreenCompatibilityBadge.swift

47 lines
1.5 KiB
Swift
Raw Normal View History

import SwiftUI
import UIKit
// Displays the UGreen NAS compatibility indicator.
// If you add an image named "ugreen_logo" to Assets.xcassets it will be used automatically.
// Otherwise a brand-styled text badge is shown.
struct UGreenCompatibilityBadge: View {
private static let ugreenGreen = Color(hex: "#00B388")
private let hasLogo = UIImage(named: "ugreen_logo") != nil
var body: some View {
HStack(spacing: 8) {
// UGreen logo or fallback wordmark
if hasLogo {
Image("ugreen_logo")
.resizable()
.scaledToFit()
.frame(height: 14)
} else {
HStack(spacing: 4) {
// Brand dot
Circle()
.fill(Self.ugreenGreen)
.frame(width: 6, height: 6)
Text("UGreen NAS")
.font(.system(size: 11, weight: .semibold))
.foregroundStyle(Self.ugreenGreen)
}
}
// Separator
Rectangle()
.fill(AppTheme.inkQuaternary)
.frame(width: 0.5, height: 11)
// Protocol hint
Text("SMB · SFTP")
.font(.system(size: 11, weight: .regular))
.foregroundStyle(AppTheme.inkTertiary)
}
.padding(.horizontal, 12)
.padding(.vertical, 6)
.background(AppTheme.surfaceSunken)
.clipShape(Capsule(style: .continuous))
}
}