43 lines
967 B
Swift

//
// DocumentToolbar.swift
// Browse
//
// Created by Javier Cicchelli on 18/12/2022.
// Copyright © 2022 Röck+Cöde. All rights reserved.
//
import DataModels
import SwiftUI
struct DocumentToolbar: ToolbarContent {
// MARK: Properties
let disabled: Bool
let downloadFile: ActionClosure
// MARK: Body
var body: some ToolbarContent {
ToolbarItem(placement: .primaryAction) {
Button {
downloadFile()
} label: {
Label {
Text(
"document.toolbar_item.button.download_file.text",
bundle: .module
)
} icon: {
Image.download
.resizable()
.scaledToFit()
.frame(width: 24, height: 24)
}
}
.disabled(disabled)
}
}
}