This commit is contained in:
2025-07-13 17:51:52 -04:00
parent 6cd44579e2
commit d4514805e9
33 changed files with 1295 additions and 80 deletions

View File

@ -0,0 +1,50 @@
//
// ListItem.swift
// Workouts
//
// Created by rzen on 7/13/25 at 10:42AM.
//
// Copyright 2025 Rouslan Zenetl. All Rights Reserved.
//
import SwiftUI
struct ListItem: View {
var title: String
var subtitle: String?
var count: Int?
var badges: [Badge]? = []
var body: some View {
HStack {
VStack (alignment: .leading) {
Text("\(title)")
HStack {
if let subtitle = subtitle {
Text("\(subtitle)")
.font(.footnote)
}
if let badges = badges {
ForEach (badges, id: \.self) { badge in
Text("\(badge.text)")
.bold()
.padding([.leading,.trailing], 5)
.cornerRadius(4)
.background(badge.color)
.foregroundColor(.white)
}
}
}
}
if let count = count {
Spacer()
Text("\(count)")
.font(.caption)
.foregroundColor(.gray)
}
}
.frame(maxWidth: .infinity, alignment: .leading)
.contentShape(Rectangle())
}
}