forked from sagnik/Project_Velocity
39 lines
1.2 KiB
Swift
39 lines
1.2 KiB
Swift
import SwiftUI
|
|
|
|
struct DashboardView: View {
|
|
private let columns = [GridItem(.adaptive(minimum: 220), spacing: 16)]
|
|
|
|
var body: some View {
|
|
ScrollView {
|
|
LazyVGrid(columns: columns, spacing: 16) {
|
|
WidgetCard(title: "Listings", value: "128", subtitle: "Active units")
|
|
WidgetCard(title: "Revenue", value: "$3.2M", subtitle: "30-day forecast")
|
|
WidgetCard(title: "AI Jobs", value: "24", subtitle: "Queue depth")
|
|
WidgetCard(title: "Visitors", value: "17", subtitle: "Today")
|
|
}
|
|
.padding(20)
|
|
}
|
|
.navigationTitle("Dashboard")
|
|
}
|
|
}
|
|
|
|
private struct WidgetCard: View {
|
|
let title: String
|
|
let value: String
|
|
let subtitle: String
|
|
|
|
var body: some View {
|
|
VStack(alignment: .leading, spacing: 8) {
|
|
Text(title)
|
|
.font(.headline)
|
|
Text(value)
|
|
.font(.largeTitle.bold())
|
|
Text(subtitle)
|
|
.foregroundStyle(.secondary)
|
|
}
|
|
.frame(maxWidth: .infinity, minHeight: 140, alignment: .leading)
|
|
.padding()
|
|
.background(.regularMaterial, in: RoundedRectangle(cornerRadius: 18))
|
|
}
|
|
}
|