TempTrack-iOS/TempTrack/Views/HistoryListRow.swift

30 lines
627 B
Swift
Raw Normal View History

import SwiftUI
import SFSafeSymbols
private let df: DateFormatter = {
let df = DateFormatter()
df.dateStyle = .short
df.timeStyle = .none
return df
}()
struct HistoryListRow: View {
let entry: MeasurementDailyCount
var body: some View {
HStack {
Image(systemSymbol: .calendar)
Text(df.string(from: entry.date))
Spacer()
Text("\(entry.count)")
}
}
}
struct HistoryListRow_Previews: PreviewProvider {
static var previews: some View {
HistoryListRow(entry: .init(dateIndex: Date().dateIndex, count: 123))
}
}