40 lines
754 B
Swift
40 lines
754 B
Swift
//
|
|
// BoxBtnView.swift
|
|
// AcaMate
|
|
//
|
|
// Created by TAnine on 2/4/25.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct BoxBtnView<Content: View>: View {
|
|
let width: CGFloat
|
|
let height: CGFloat
|
|
let action: VOID_TO_VOID?
|
|
|
|
@ViewBuilder let content: Content
|
|
|
|
var body: some View {
|
|
Button{
|
|
guard let action = action else { return }
|
|
action()
|
|
} label: {
|
|
content
|
|
// if let image = image {
|
|
// image
|
|
// .resizable()
|
|
// .frame(width: width, height: height)
|
|
// }
|
|
}
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
BoxBtnView(width: 40, height: 40, action: nil){
|
|
VStack {
|
|
Text("Test1")
|
|
Text("Test2")
|
|
}
|
|
}
|
|
}
|