import AVFoundation import MobileCoreServices import Photos import SwiftUI struct MediaPickerView: View { @State private var selectedItems: [String] = [] var body: some View { let columns = Array(repeating: GridItem(.flexible(), spacing: 0), count: 3) VStack(spacing: 0) { // List of media ScrollView(showsIndicators: false) { LazyVGrid(columns: columns, spacing: 0) { // For camera CameraCellPreview() // For gallery GalleryView() } } // Send panel Rectangle() .foregroundColor(.Material.Shape.black) .frame(maxWidth: .infinity) .frame(height: self.selectedItems.isEmpty ? 0 : 50) .overlay { HStack { Text(L10n.Attachment.Send.media) .foregroundColor(.Material.Text.white) .font(.body1) Image(systemName: "arrow.up.circle") .foregroundColor(.Material.Text.white) .font(.body1) .padding(.leading, 8) } .padding() } .clipped() .onTapGesture { // store.dispatch(.sharingAction(.shareMedia(ids: selectedItems))) // store.dispatch(.sharingAction(.showSharing(false))) } } } }