Learn Courses My Dashboard

Trying to get buttons to perform separate actions

Could someone help guide me? I have this code below that aligns my array of button names but I need each button to do its own action when pressed. As it is, whatever action I sign to the button - all the buttons do the same action. I would appreciate any help, Todd

struct PE: View {
    var spacing: CGFloat = 8
    var padding: CGFloat = 8
    var wordCount: Int = 75
    var alignmentIndex = 0

    var poswords: [String] {
    var negwords: [String] {

    let alignments: [HorizontalAlignment] = [.leading, .center, .trailing]

    var alignment: HorizontalAlignment {
   @State private var note: String = ""
    var p:Pizza
    var body: some View {
        // Positive findings
        SwiftUI.ScrollView {
            data: poswords,
            spacing: spacing,
            alignment: alignment
          ){ topping in
          Button(topping) {}