another.im-ios/ConversationsClassic/AppCore/State/SharingState.swift
2024-07-16 13:48:50 +02:00

39 lines
811 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 = []
}
}