Repository: Automattic/pocket-casts-ios
File: podcasts/Common SwiftUI/BannerView.swift (Swift)

Code before:
                    } label: {
                        Text(action)
                            .font(.caption.weight(.semibold))
                            .foregroundColor(theme.primaryInteractive01)
                    }
                }
            }
            Spacer()
        }
        .overlay(alignment: .topTrailing) {
            if model.onCloseTap != nil {
                Button() {
                    model.onCloseTap?()
                } label: {
                    Image("close")
                        .renderingMode(.template)
                        .foregroundColor(theme.primaryIcon02)
                }
                .padding(8)
            }
        }
        .padding()
        .background(backgroundColor)
        .cornerRadius(8)
        .background(theme.primaryUi04)
        .padding()
    }
}

#Preview("Light") {
    BannerView(model: .init(title: "Manage Title", message: "Manage Message", action: "Do Action"))
        .environmentObject(Theme(previewTheme: .light))
        .padding(16)
        .frame(height: 132)
}

#Preview("Dark") {
    BannerView(model: .init(title: "Manage Title", message: "Manage Message", action: "Do Action"))
        .environmentObject(Theme(previewTheme: .dark))
        .padding(16)
        .frame(height: 132)
}


Review comment (suggestion):
```suggestion
        .padding(.bottom, model.edge.bottom)
        .padding(.top, model.edge.top)
        .padding(.leading, model.edge.leading)
        .padding(.trailing, model.edge.trailing)
```
Can we inject and `EdgeInsets` into the model? In the account creation I need to adjust the top/bottom values based on the section

Code after:
                        .fixedSize(horizontal: false, vertical: true)
                        .multilineTextAlignment(.leading)
                        .foregroundColor(theme.primaryText02)
                }
                if let action = model.action {
                    Button() {
                        model.onActionTap?()
                    } label: {
                        Text(action)
                            .font(.caption.weight(.semibold))
                            .foregroundColor(theme.primaryInteractive01)
                    }
                }
            }
            Spacer()
        }
        .padding(.leading, model.iconName == nil ? 24 : 16)
        .padding(.trailing, model.onCloseTap == nil ? 16 : 56)
        .padding(.vertical, 16)
        .overlay(alignment: .topTrailing) {
            if model.onCloseTap != nil {
                Button() {
                    model.onCloseTap?()
                } label: {
                    Image("close")
                        .renderingMode(.template)
                        .foregroundColor(theme.primaryIcon02)
                }
                .padding(8)
            }
        }
        .background(backgroundColor)
        .cornerRadius(8)
        .background(theme.primaryUi04)
        .if(edgeInsets != nil) { content in
            content.padding(edgeInsets ?? EdgeInsets())
        }
        .if(edgeInsets == nil) { content in
            content.padding()
        }
    }
}

#Preview("Light") {
    BannerView(model: .init(title: "Manage Title", message: "Manage Message", action: "Do Action"))
        .environmentObject(Theme(previewTheme: .light))
        .padding(16)
        .frame(height: 132)
}

#Preview("Dark") {