//
//  ActionButton.swift
//  TidepoolOnboarding
//
//  Created by Darin Krauss on 1/28/21.
//  Copyright © 2021 Tidepool Project. All rights reserved.
//

import SwiftUI
import LoopKitUI

struct ActionButton: View {
    let title: String
    let action: () -> Void

    var body: some View {
        Button(action: action) {
            Text(title)
                .multilineTextAlignment(.center)
        }
        .buttonStyle(ActionButtonStyle())
        .accessibilityElement()
        .accessibilityAddTraits(.isButton)
        .accessibilityLabel(title)
    }
}

struct ActionButton_Previews: PreviewProvider {
    static var previews: some View {
        ContentPreviewWithBackground {
            ActionButton(title: "Action", action: {})
        }
    }
}
