59 lines
1.4 KiB
Swift
59 lines
1.4 KiB
Swift
//
|
|
// ProjectListItem.swift
|
|
// GasTankAR
|
|
//
|
|
// Created by Dennis Nemec on 25.08.26.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct ProjectListItem: View {
|
|
let project: Project
|
|
|
|
var body: some View {
|
|
HStack(spacing: 12) {
|
|
Circle()
|
|
.fill(.tint)
|
|
.frame(width: 40, height: 40)
|
|
.overlay {
|
|
Text(project.initials)
|
|
.font(.subheadline.weight(.semibold))
|
|
.foregroundStyle(.white)
|
|
}
|
|
|
|
VStack(alignment: .leading, spacing: 2) {
|
|
Text(project.customerName)
|
|
.font(.body)
|
|
Text(project.leadID)
|
|
.font(.caption)
|
|
.foregroundStyle(.secondary)
|
|
}
|
|
|
|
Spacer()
|
|
|
|
Text(project.creationDate, format: .dateTime.day().month().year())
|
|
.font(.caption)
|
|
.foregroundStyle(.secondary)
|
|
}
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
List {
|
|
ProjectListItem(
|
|
project: Project(
|
|
leadID: "LEAD-1001",
|
|
customerName: "Müller Heizungsbau",
|
|
creationDate: .now
|
|
)
|
|
)
|
|
ProjectListItem(
|
|
project: Project(
|
|
leadID: "LEAD-1002",
|
|
customerName: "Weber & Söhne",
|
|
creationDate: .now
|
|
)
|
|
)
|
|
}
|
|
}
|