2024-02-05 23:31:54 -07:00
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
|
|
struct TextMessageSize: View {
|
|
|
|
|
let maxbytes: Int
|
|
|
|
|
let totalBytes: Int
|
2024-05-29 16:40:07 -05:00
|
|
|
|
2024-02-05 23:31:54 -07:00
|
|
|
var body: some View {
|
2025-02-15 12:17:22 -08:00
|
|
|
ProgressView("\("Bytes".localized): \(totalBytes) / \(maxbytes)", value: Double(totalBytes), total: Double(maxbytes))
|
2025-05-20 21:16:12 -07:00
|
|
|
.accessibilityLabel(NSLocalizedString("Message Size", comment: "VoiceOver label for message size"))
|
|
|
|
|
.accessibilityValue(String(format: NSLocalizedString("Bytes Used", comment: "VoiceOver value for bytes used"), totalBytes, maxbytes))
|
2024-02-05 23:31:54 -07:00
|
|
|
.frame(width: 130)
|
|
|
|
|
.padding(5)
|
|
|
|
|
.font(.subheadline)
|
|
|
|
|
.accentColor(.accentColor)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct TextMessageSizePreview: PreviewProvider {
|
|
|
|
|
static var previews: some View {
|
2024-09-17 14:15:33 -07:00
|
|
|
TextMessageSize(maxbytes: 200, totalBytes: 100)
|
2024-02-05 23:31:54 -07:00
|
|
|
}
|
|
|
|
|
}
|