Initial commit for first version of project
This commit is contained in:
58
GasTankAR/Views/ProjectListItem.swift
Normal file
58
GasTankAR/Views/ProjectListItem.swift
Normal file
@ -0,0 +1,58 @@
|
||||
//
|
||||
// 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
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user