TempTrack-iOS/TempTrack/Views/HistoryListRow.swift
2023-06-08 09:52:20 +02:00

30 lines
627 B
Swift

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))
}
}