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

Code before:
                }
                if let action = model.action {
                    Button() {
                        model.onActionTap?()
                    } 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(.vertical, 20.0)
        .padding(.leading, 16.0)
        .padding(.trailing, model.onCloseTap != nil ? 56.0 : 16.0)
```
if the close button is present, we should probably add a trailing padding of 56 otherwise the `X` button will be too close to the text. The suggestion contains the value I used for the account creation

Code after:
                }
                if let message = model.message {
                    Text(message)
                        .font(.caption2.weight(.semibold))
                        .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)