Files
swiftapp/swift/Sources/Core/Design/LaneChip.swift
T

25 lines
704 B
Swift

import SwiftUI
struct LaneChip: View {
let lane: Lane
var count: Int?
var body: some View {
HStack(spacing: 5) {
Circle()
.fill(lane.color)
.frame(width: 7, height: 7)
Text(lane.label.uppercased())
if let count {
Text(count, format: .number)
.foregroundStyle(lane.color.opacity(0.8))
}
}
.font(.caption2.weight(.semibold))
.padding(.horizontal, 9)
.padding(.vertical, 3)
.background(lane.color.opacity(0.14), in: RoundedRectangle(cornerRadius: SIO.chipRadius, style: .continuous))
.foregroundStyle(lane.color)
}
}