MNN/apps/iOS/MNNLLMChat/MNNLLMiOS/MainTab/CommonToolbarView.swift

44 lines
1.3 KiB
Swift
Raw Normal View History

//
// CommonToolbarView.swift
// MNNLLMiOS
//
// Created by () on 2025/07/18.
//
import SwiftUI
struct CommonToolbarView: ToolbarContent {
@Binding var showHistory: Bool
@Binding var showHistoryButton: Bool
var body: some ToolbarContent {
ToolbarItem(placement: .navigationBarLeading) {
if showHistoryButton {
Button(action: {
showHistory = true
showHistoryButton = false
}) {
Image(systemName: "sidebar.left")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 20, height: 20)
.foregroundColor(.black)
}
}
}
ToolbarItem(placement: .navigationBarTrailing) {
Button(action: {
if let url = URL(string: "https://github.com/alibaba/MNN") {
UIApplication.shared.open(url)
}
}) {
Image(systemName: "star")
2025-07-18 17:25:22 +08:00
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 20, height: 20)
.foregroundColor(.black)
}
}
}
}