conversations-classic-ios/ConversationsClassic/AppCore/State/SharingState.swift
2024-07-10 19:49:36 +02:00

39 lines
799 B
Swift

import Foundation
enum SharingCameraMediaType: Stateable {
case video
case photo
}
struct SharingGalleryItem: Stateable, Identifiable {
var id: String
var type: SharingCameraMediaType
var thumbnail: Data?
var duration: String?
}
struct SharingState: Stateable {
var sharingShown: Bool
var isCameraAccessGranted: Bool
var isGalleryAccessGranted: Bool
var cameraCapturedMedia: Data
var cameraCapturedMediaType: SharingCameraMediaType
var galleryItems: [SharingGalleryItem]
}
// MARK: Init
extension SharingState {
init() {
sharingShown = false
isCameraAccessGranted = false
isGalleryAccessGranted = false
cameraCapturedMedia = Data()
cameraCapturedMediaType = .photo
galleryItems = []
}
}