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