| struct WatchEntryRowView: View {
let entry: WatchEntry
let showAsBeen: Bool
var distanceText: String? = nil
var showPriority: Bool = true
var body: some View {
VStack(alignment: .leading, spacing: 2) {
Text(entry.playName)
.font(.system(size: 14, weight: .semibold))
.foregroundColor(lavender)
.lineLimit(2)
if !entry.cuisine.isEmpty {
Text(entry.cuisine)
.font(.system(size: 12))
.foregroundColor(.white)
.lineLimit(1)
}
if let dist = distanceText {
Text(dist)
.font(.system(size: 11))
.foregroundColor(.blue.opacity(0.9))
.lineLimit(1)
} else if !entry.neighborhood.isEmpty {
Text(entry.neighborhood)
.font(.system(size: 11))
.foregroundColor(.white.opacity(0.75))
.lineLimit(1)
}
if showAsBeen && entry.starRating > 0 {
HStack(spacing: 2) {
ForEach(1...5, id: \.self) { star in
Image(systemName: star <= entry.starRating ? "star.fill" : "star")
.font(.system(size: 7))
.foregroundColor(star <= entry.starRating ? .yellow : .gray.opacity(0.4))
}
}
} else if showPriority && entry.rating > 0 {
HStack(spacing: 2) {
ForEach(1...5, id: \.self) { dot in
Image(systemName: dot <= entry.rating ? "circle.fill" : "circle")
.font(.system(size: 7))
.foregroundColor(dot <= entry.rating ? .white : .gray.opacity(0.3))
}
}
}
}
.padding(.vertical, 2)
}
} | `WatchEntryRowView` struct | Defines the `WatchEntryRowView` struct. Conforms to View. |