import SwiftUI

struct InvitationBanner: View {
    let invitation: Invitation
    let onAccept: () -> Void
    let onDecline: () -> Void

    var body: some View {
        VStack(alignment: .leading, spacing: 8) {
            HStack {
                Image(systemName: "envelope.badge")
                    .foregroundStyle(.orange)

                VStack(alignment: .leading) {
                    Text(invitation.conversationName)
                        .font(.body.bold())
                    Text("Invited by \(invitation.invitedByUsername)")
                        .font(.caption)
                        .foregroundStyle(.secondary)
                }

                Spacer()
            }

            HStack(spacing: 12) {
                Button("Accept") {
                    onAccept()
                }
                .buttonStyle(.borderedProminent)
                .controlSize(.small)

                Button("Decline") {
                    onDecline()
                }
                .buttonStyle(.bordered)
                .controlSize(.small)
            }
        }
        .padding(.vertical, 4)
    }
}
