| 1234567891011121314151617181920212223242526272829303132 |
- //
- // ProductView.swift
- // SUIExamples
- //
- // Created by Pavel Yurchenko on 17.08.2024.
- //
- import SwiftUI
- struct ProductView: View {
- @Environment(ProductVM.self) private var vm
- var body: some View {
- VStack {
- Text("Product")
- Spacer()
- Text("#\(vm.objectId)")
- Spacer()
- Button("Products") {
- vm.output.onProducts?()
- }
- Button("Cart") {
- vm.output.onCart?()
- }
- }
- .padding()
- }
- }
- #Preview {
- ProductBuilder().build(with: .init(id: 25), output: .init())
- }
|