38 lines
1.4 KiB
Swift
38 lines
1.4 KiB
Swift
import SwiftUI
|
|
|
|
struct BookmarkedLeadsSection: View {
|
|
let leads: [Lead]
|
|
let columns: [GridItem]
|
|
let flyingLeadID: String?
|
|
let cardMotion: Namespace.ID
|
|
let isBusy: Bool
|
|
let onOpen: (Lead) -> Void
|
|
let onBookmark: (Lead) -> Void
|
|
|
|
var body: some View {
|
|
VStack(alignment: .leading, spacing: 14) {
|
|
HStack(alignment: .firstTextBaseline, spacing: 8) {
|
|
Text("Gemerkt").font(.title2.bold())
|
|
Text(leads.count, format: .number)
|
|
.foregroundStyle(.secondary)
|
|
}
|
|
if leads.isEmpty {
|
|
Text("Mit dem Lesezeichen kannst du dir Interessenten merken.")
|
|
.font(.subheadline)
|
|
.foregroundStyle(.secondary)
|
|
}
|
|
LeadCardGrid(columnCount: columns.count) {
|
|
ForEach(leads) { lead in
|
|
BookmarkedLeadCardView(lead: lead, isBusy: isBusy,
|
|
onOpen: { onOpen(lead) },
|
|
onBookmark: { onBookmark(lead) })
|
|
.matchedGeometryEffect(id: "flight-\(lead.id)", in: cardMotion)
|
|
.opacity(flyingLeadID == lead.id ? 0 : 1)
|
|
.transition(.identity)
|
|
.zIndex(1)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|